@sequenza/workbench 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -69
- package/app/assets/index-D4zKdPfC.css +1 -0
- package/app/assets/index-b-fcoZFF.js +900 -0
- package/app/index.html +2 -2
- package/dist/index.d.ts +11 -4
- package/dist/sequenza.js +1459 -1263
- package/package.json +2 -2
- package/app/assets/index-BbK7hGuP.css +0 -1
- package/app/assets/index-CdVswdI1.js +0 -70
|
@@ -0,0 +1,900 @@
|
|
|
1
|
+
(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function o(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(s){if(s.ep)return;s.ep=!0;const u=o(s);fetch(s.href,u)}})();function yv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Dd={exports:{}},ka={};var wy;function kS(){if(wy)return ka;wy=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(a,s,u){var f=null;if(u!==void 0&&(f=""+u),s.key!==void 0&&(f=""+s.key),"key"in s){u={};for(var h in s)h!=="key"&&(u[h]=s[h])}else u=s;return s=u.ref,{$$typeof:t,type:a,key:f,ref:s!==void 0?s:null,props:u}}return ka.Fragment=r,ka.jsx=o,ka.jsxs=o,ka}var Ay;function VS(){return Ay||(Ay=1,Dd.exports=kS()),Dd.exports}var A=VS(),Od={exports:{}},we={};var Ty;function GS(){if(Ty)return we;Ty=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function _(M){return M===null||typeof M!="object"?null:(M=x&&M[x]||M["@@iterator"],typeof M=="function"?M:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function w(M,k,W){this.props=M,this.context=k,this.refs=C,this.updater=W||b}w.prototype.isReactComponent={},w.prototype.setState=function(M,k){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,k,"setState")},w.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function D(){}D.prototype=w.prototype;function S(M,k,W){this.props=M,this.context=k,this.refs=C,this.updater=W||b}var N=S.prototype=new D;N.constructor=S,E(N,w.prototype),N.isPureReactComponent=!0;var O=Array.isArray;function z(){}var B={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function I(M,k,W){var ne=W.ref;return{$$typeof:t,type:M,key:k,ref:ne!==void 0?ne:null,props:W}}function ae(M,k){return I(M.type,k,M.props)}function V(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function $(M){var k={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(W){return k[W]})}var ee=/\/+/g;function U(M,k){return typeof M=="object"&&M!==null&&M.key!=null?$(""+M.key):k.toString(36)}function X(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(z,z):(M.status="pending",M.then(function(k){M.status==="pending"&&(M.status="fulfilled",M.value=k)},function(k){M.status==="pending"&&(M.status="rejected",M.reason=k)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function R(M,k,W,ne,se){var he=typeof M;(he==="undefined"||he==="boolean")&&(M=null);var ce=!1;if(M===null)ce=!0;else switch(he){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(M.$$typeof){case t:case r:ce=!0;break;case y:return ce=M._init,R(ce(M._payload),k,W,ne,se)}}if(ce)return se=se(M),ce=ne===""?"."+U(M,0):ne,O(se)?(W="",ce!=null&&(W=ce.replace(ee,"$&/")+"/"),R(se,k,W,"",function(ge){return ge})):se!=null&&(V(se)&&(se=ae(se,W+(se.key==null||M&&M.key===se.key?"":(""+se.key).replace(ee,"$&/")+"/")+ce)),k.push(se)),1;ce=0;var ue=ne===""?".":ne+":";if(O(M))for(var de=0;de<M.length;de++)ne=M[de],he=ue+U(ne,de),ce+=R(ne,k,W,he,se);else if(de=_(M),typeof de=="function")for(M=de.call(M),de=0;!(ne=M.next()).done;)ne=ne.value,he=ue+U(ne,de++),ce+=R(ne,k,W,he,se);else if(he==="object"){if(typeof M.then=="function")return R(X(M),k,W,ne,se);throw k=String(M),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return ce}function H(M,k,W){if(M==null)return M;var ne=[],se=0;return R(M,ne,"","",function(he){return k.call(W,he,se++)}),ne}function F(M){if(M._status===-1){var k=M._result;k=k(),k.then(function(W){(M._status===0||M._status===-1)&&(M._status=1,M._result=W)},function(W){(M._status===0||M._status===-1)&&(M._status=2,M._result=W)}),M._status===-1&&(M._status=0,M._result=k)}if(M._status===1)return M._result.default;throw M._result}var P=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},te={map:H,forEach:function(M,k,W){H(M,function(){k.apply(this,arguments)},W)},count:function(M){var k=0;return H(M,function(){k++}),k},toArray:function(M){return H(M,function(k){return k})||[]},only:function(M){if(!V(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return we.Activity=g,we.Children=te,we.Component=w,we.Fragment=o,we.Profiler=s,we.PureComponent=S,we.StrictMode=a,we.Suspense=p,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,we.__COMPILER_RUNTIME={__proto__:null,c:function(M){return B.H.useMemoCache(M)}},we.cache=function(M){return function(){return M.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(M,k,W){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var ne=E({},M.props),se=M.key;if(k!=null)for(he in k.key!==void 0&&(se=""+k.key),k)!q.call(k,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&k.ref===void 0||(ne[he]=k[he]);var he=arguments.length-2;if(he===1)ne.children=W;else if(1<he){for(var ce=Array(he),ue=0;ue<he;ue++)ce[ue]=arguments[ue+2];ne.children=ce}return I(M.type,se,ne)},we.createContext=function(M){return M={$$typeof:f,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:u,_context:M},M},we.createElement=function(M,k,W){var ne,se={},he=null;if(k!=null)for(ne in k.key!==void 0&&(he=""+k.key),k)q.call(k,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(se[ne]=k[ne]);var ce=arguments.length-2;if(ce===1)se.children=W;else if(1<ce){for(var ue=Array(ce),de=0;de<ce;de++)ue[de]=arguments[de+2];se.children=ue}if(M&&M.defaultProps)for(ne in ce=M.defaultProps,ce)se[ne]===void 0&&(se[ne]=ce[ne]);return I(M,he,se)},we.createRef=function(){return{current:null}},we.forwardRef=function(M){return{$$typeof:h,render:M}},we.isValidElement=V,we.lazy=function(M){return{$$typeof:y,_payload:{_status:-1,_result:M},_init:F}},we.memo=function(M,k){return{$$typeof:m,type:M,compare:k===void 0?null:k}},we.startTransition=function(M){var k=B.T,W={};B.T=W;try{var ne=M(),se=B.S;se!==null&&se(W,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(z,P)}catch(he){P(he)}finally{k!==null&&W.types!==null&&(k.types=W.types),B.T=k}},we.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},we.use=function(M){return B.H.use(M)},we.useActionState=function(M,k,W){return B.H.useActionState(M,k,W)},we.useCallback=function(M,k){return B.H.useCallback(M,k)},we.useContext=function(M){return B.H.useContext(M)},we.useDebugValue=function(){},we.useDeferredValue=function(M,k){return B.H.useDeferredValue(M,k)},we.useEffect=function(M,k){return B.H.useEffect(M,k)},we.useEffectEvent=function(M){return B.H.useEffectEvent(M)},we.useId=function(){return B.H.useId()},we.useImperativeHandle=function(M,k,W){return B.H.useImperativeHandle(M,k,W)},we.useInsertionEffect=function(M,k){return B.H.useInsertionEffect(M,k)},we.useLayoutEffect=function(M,k){return B.H.useLayoutEffect(M,k)},we.useMemo=function(M,k){return B.H.useMemo(M,k)},we.useOptimistic=function(M,k){return B.H.useOptimistic(M,k)},we.useReducer=function(M,k,W){return B.H.useReducer(M,k,W)},we.useRef=function(M){return B.H.useRef(M)},we.useState=function(M){return B.H.useState(M)},we.useSyncExternalStore=function(M,k,W){return B.H.useSyncExternalStore(M,k,W)},we.useTransition=function(){return B.H.useTransition()},we.version="19.2.4",we}var Cy;function hl(){return Cy||(Cy=1,Od.exports=GS()),Od.exports}var j=hl();const qS=yv(j);var zd={exports:{}},Va={},Bd={exports:{}},Ud={};var Ny;function XS(){return Ny||(Ny=1,(function(t){function r(R,H){var F=R.length;R.push(H);e:for(;0<F;){var P=F-1>>>1,te=R[P];if(0<s(te,H))R[P]=H,R[F]=te,F=P;else break e}}function o(R){return R.length===0?null:R[0]}function a(R){if(R.length===0)return null;var H=R[0],F=R.pop();if(F!==H){R[0]=F;e:for(var P=0,te=R.length,M=te>>>1;P<M;){var k=2*(P+1)-1,W=R[k],ne=k+1,se=R[ne];if(0>s(W,F))ne<te&&0>s(se,W)?(R[P]=se,R[ne]=F,P=ne):(R[P]=W,R[k]=F,P=k);else if(ne<te&&0>s(se,F))R[P]=se,R[ne]=F,P=ne;else break e}}return H}function s(R,H){var F=R.sortIndex-H.sortIndex;return F!==0?F:R.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,h=f.now();t.unstable_now=function(){return f.now()-h}}var p=[],m=[],y=1,g=null,x=3,_=!1,b=!1,E=!1,C=!1,w=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function N(R){for(var H=o(m);H!==null;){if(H.callback===null)a(m);else if(H.startTime<=R)a(m),H.sortIndex=H.expirationTime,r(p,H);else break;H=o(m)}}function O(R){if(E=!1,N(R),!b)if(o(p)!==null)b=!0,z||(z=!0,$());else{var H=o(m);H!==null&&X(O,H.startTime-R)}}var z=!1,B=-1,q=5,I=-1;function ae(){return C?!0:!(t.unstable_now()-I<q)}function V(){if(C=!1,z){var R=t.unstable_now();I=R;var H=!0;try{e:{b=!1,E&&(E=!1,D(B),B=-1),_=!0;var F=x;try{t:{for(N(R),g=o(p);g!==null&&!(g.expirationTime>R&&ae());){var P=g.callback;if(typeof P=="function"){g.callback=null,x=g.priorityLevel;var te=P(g.expirationTime<=R);if(R=t.unstable_now(),typeof te=="function"){g.callback=te,N(R),H=!0;break t}g===o(p)&&a(p),N(R)}else a(p);g=o(p)}if(g!==null)H=!0;else{var M=o(m);M!==null&&X(O,M.startTime-R),H=!1}}break e}finally{g=null,x=F,_=!1}H=void 0}}finally{H?$():z=!1}}}var $;if(typeof S=="function")$=function(){S(V)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,U=ee.port2;ee.port1.onmessage=V,$=function(){U.postMessage(null)}}else $=function(){w(V,0)};function X(R,H){B=w(function(){R(t.unstable_now())},H)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(R){R.callback=null},t.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<R?Math.floor(1e3/R):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_next=function(R){switch(x){case 1:case 2:case 3:var H=3;break;default:H=x}var F=x;x=H;try{return R()}finally{x=F}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(R,H){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var F=x;x=R;try{return H()}finally{x=F}},t.unstable_scheduleCallback=function(R,H,F){var P=t.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?P+F:P):F=P,R){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=F+te,R={id:y++,callback:H,priorityLevel:R,startTime:F,expirationTime:te,sortIndex:-1},F>P?(R.sortIndex=F,r(m,R),o(p)===null&&R===o(m)&&(E?(D(B),B=-1):E=!0,X(O,F-P))):(R.sortIndex=te,r(p,R),b||_||(b=!0,z||(z=!0,$()))),R},t.unstable_shouldYield=ae,t.unstable_wrapCallback=function(R){var H=x;return function(){var F=x;x=H;try{return R.apply(this,arguments)}finally{x=F}}}})(Ud)),Ud}var Ry;function YS(){return Ry||(Ry=1,Bd.exports=XS()),Bd.exports}var Hd={exports:{}},Tt={};var My;function IS(){if(My)return Tt;My=1;var t=hl();function r(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var a={d:{f:o,r:function(){throw Error(r(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},s=Symbol.for("react.portal");function u(p,m,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:p,containerInfo:m,implementation:y}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Tt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Tt.createPortal=function(p,m){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(r(299));return u(p,m,null,y)},Tt.flushSync=function(p){var m=f.T,y=a.p;try{if(f.T=null,a.p=2,p)return p()}finally{f.T=m,a.p=y,a.d.f()}},Tt.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(p,m))},Tt.prefetchDNS=function(p){typeof p=="string"&&a.d.D(p)},Tt.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var y=m.as,g=h(y,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,_=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?a.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:_}):y==="script"&&a.d.X(p,{crossOrigin:g,integrity:x,fetchPriority:_,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Tt.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=h(m.as,m.crossOrigin);a.d.M(p,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(p)},Tt.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,g=h(y,m.crossOrigin);a.d.L(p,y,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Tt.preloadModule=function(p,m){if(typeof p=="string")if(m){var y=h(m.as,m.crossOrigin);a.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(p)},Tt.requestFormReset=function(p){a.d.r(p)},Tt.unstable_batchedUpdates=function(p,m){return p(m)},Tt.useFormState=function(p,m,y){return f.H.useFormState(p,m,y)},Tt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Tt.version="19.2.4",Tt}var Dy;function xv(){if(Dy)return Hd.exports;Dy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Hd.exports=IS(),Hd.exports}var Oy;function PS(){if(Oy)return Va;Oy=1;var t=YS(),r=hl(),o=xv();function a(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var n=e,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i:null}function f(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function h(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(u(e)!==e)throw Error(a(188))}function m(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(a(188));return n!==e?null:e}for(var i=e,l=n;;){var c=i.return;if(c===null)break;var d=c.alternate;if(d===null){if(l=c.return,l!==null){i=l;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===i)return p(c),e;if(d===l)return p(c),n;d=d.sibling}throw Error(a(188))}if(i.return!==l.return)i=c,l=d;else{for(var v=!1,T=c.child;T;){if(T===i){v=!0,i=c,l=d;break}if(T===l){v=!0,l=c,i=d;break}T=T.sibling}if(!v){for(T=d.child;T;){if(T===i){v=!0,i=d,l=c;break}if(T===l){v=!0,l=d,i=c;break}T=T.sibling}if(!v)throw Error(a(189))}}if(i.alternate!==l)throw Error(a(190))}if(i.tag!==3)throw Error(a(188));return i.stateNode.current===i?e:n}function y(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=y(e),n!==null)return n;e=e.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),S=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),ae=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function $(e){return e===null||typeof e!="object"?null:(e=V&&e[V]||e["@@iterator"],typeof e=="function"?e:null)}var ee=Symbol.for("react.client.reference");function U(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case w:return"Profiler";case C:return"StrictMode";case O:return"Suspense";case z:return"SuspenseList";case I:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case b:return"Portal";case S:return e.displayName||"Context";case D:return(e._context.displayName||"Context")+".Consumer";case N:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return n=e.displayName||null,n!==null?n:U(e.type)||"Memo";case q:n=e._payload,e=e._init;try{return U(e(n))}catch{}}return null}var X=Array.isArray,R=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},P=[],te=-1;function M(e){return{current:e}}function k(e){0>te||(e.current=P[te],P[te]=null,te--)}function W(e,n){te++,P[te]=e.current,e.current=n}var ne=M(null),se=M(null),he=M(null),ce=M(null);function ue(e,n){switch(W(he,n),W(se,e),W(ne,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?Pg(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=Pg(n),e=$g(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}k(ne),W(ne,e)}function de(){k(ne),k(se),k(he)}function ge(e){e.memoizedState!==null&&W(ce,e);var n=ne.current,i=$g(n,e.type);n!==i&&(W(se,e),W(ne,i))}function Se(e){se.current===e&&(k(ne),k(se)),ce.current===e&&(k(ce),Ha._currentValue=F)}var be,Ee;function oe(e){if(be===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);be=n&&n[1]||"",Ee=-1<i.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+be+e+Ee}var fe=!1;function me(e,n){if(!e||fe)return"";fe=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(n){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(J){var K=J}Reflect.construct(e,[],le)}else{try{le.call()}catch(J){K=J}e.call(le.prototype)}}else{try{throw Error()}catch(J){K=J}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(J){if(J&&K&&typeof J.stack=="string")return[J.stack,K.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=l.DetermineComponentFrameRoot(),v=d[0],T=d[1];if(v&&T){var L=v.split(`
|
|
4
|
+
`),Q=T.split(`
|
|
5
|
+
`);for(c=l=0;l<L.length&&!L[l].includes("DetermineComponentFrameRoot");)l++;for(;c<Q.length&&!Q[c].includes("DetermineComponentFrameRoot");)c++;if(l===L.length||c===Q.length)for(l=L.length-1,c=Q.length-1;1<=l&&0<=c&&L[l]!==Q[c];)c--;for(;1<=l&&0<=c;l--,c--)if(L[l]!==Q[c]){if(l!==1||c!==1)do if(l--,c--,0>c||L[l]!==Q[c]){var re=`
|
|
6
|
+
`+L[l].replace(" at new "," at ");return e.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",e.displayName)),re}while(1<=l&&0<=c);break}}}finally{fe=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?oe(i):""}function Ce(e,n){switch(e.tag){case 26:case 27:case 5:return oe(e.type);case 16:return oe("Lazy");case 13:return e.child!==n&&n!==null?oe("Suspense Fallback"):oe("Suspense");case 19:return oe("SuspenseList");case 0:case 15:return me(e.type,!1);case 11:return me(e.type.render,!1);case 1:return me(e.type,!0);case 31:return oe("Activity");default:return""}}function je(e){try{var n="",i=null;do n+=Ce(e,i),i=e,e=e.return;while(e);return n}catch(l){return`
|
|
7
|
+
Error generating stack: `+l.message+`
|
|
8
|
+
`+l.stack}}var Le=Object.prototype.hasOwnProperty,tt=t.unstable_scheduleCallback,it=t.unstable_cancelCallback,$e=t.unstable_shouldYield,Wt=t.unstable_requestPaint,at=t.unstable_now,Wr=t.unstable_getCurrentPriorityLevel,cn=t.unstable_ImmediatePriority,Sn=t.unstable_UserBlockingPriority,Nt=t.unstable_NormalPriority,eo=t.unstable_LowPriority,hr=t.unstable_IdlePriority,Yi=t.log,Ii=t.unstable_setDisableYieldValue,to=null,Rt=null;function wn(e){if(typeof Yi=="function"&&Ii(e),Rt&&typeof Rt.setStrictMode=="function")try{Rt.setStrictMode(to,e)}catch{}}var Mt=Math.clz32?Math.clz32:xc,gc=Math.log,yc=Math.LN2;function xc(e){return e>>>=0,e===0?32:31-(gc(e)/yc|0)|0}var Fo=256,ko=262144,Vo=4194304;function kn(e){var n=e&42;if(n!==0)return n;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Go(e,n,i){var l=e.pendingLanes;if(l===0)return 0;var c=0,d=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var T=l&134217727;return T!==0?(l=T&~d,l!==0?c=kn(l):(v&=T,v!==0?c=kn(v):i||(i=T&~e,i!==0&&(c=kn(i))))):(T=l&~d,T!==0?c=kn(T):v!==0?c=kn(v):i||(i=l&~e,i!==0&&(c=kn(i)))),c===0?0:n!==0&&n!==c&&(n&d)===0&&(d=c&-c,i=n&-n,d>=i||d===32&&(i&4194048)!==0)?n:c}function no(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function vc(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32: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 n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Al(){var e=Vo;return Vo<<=1,(Vo&62914560)===0&&(Vo=4194304),e}function Pi(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function ro(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bc(e,n,i,l,c,d){var v=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var T=e.entanglements,L=e.expirationTimes,Q=e.hiddenUpdates;for(i=v&~i;0<i;){var re=31-Mt(i),le=1<<re;T[re]=0,L[re]=-1;var K=Q[re];if(K!==null)for(Q[re]=null,re=0;re<K.length;re++){var J=K[re];J!==null&&(J.lane&=-536870913)}i&=~le}l!==0&&Tl(e,l,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(v&~n))}function Tl(e,n,i){e.pendingLanes|=n,e.suspendedLanes&=~n;var l=31-Mt(n);e.entangledLanes|=n,e.entanglements[l]=e.entanglements[l]|1073741824|i&261930}function Cl(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var l=31-Mt(i),c=1<<l;c&n|e[l]&n&&(e[l]|=n),i&=~c}}function Nl(e,n){var i=n&-n;return i=(i&42)!==0?1:$i(i),(i&(e.suspendedLanes|n))!==0?0:i}function $i(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Zi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Rl(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:yy(e.type))}function Ml(e,n){var i=H.p;try{return H.p=e,n()}finally{H.p=i}}var An=Math.random().toString(36).slice(2),yt="__reactFiber$"+An,At="__reactProps$"+An,Vn="__reactContainer$"+An,qo="__reactEvents$"+An,Dl="__reactListeners$"+An,_c="__reactHandles$"+An,Ol="__reactResources$"+An,oo="__reactMarker$"+An;function Qi(e){delete e[yt],delete e[At],delete e[qo],delete e[Dl],delete e[_c]}function mr(e){var n=e[yt];if(n)return n;for(var i=e.parentNode;i;){if(n=i[Vn]||i[yt]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=ty(e);e!==null;){if(i=e[yt])return i;e=ty(e)}return n}e=i,i=e.parentNode}return null}function pr(e){if(e=e[yt]||e[Vn]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function gr(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function yr(e){var n=e[Ol];return n||(n=e[Ol]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function ut(e){e[oo]=!0}var zl=new Set,Bl={};function Gn(e,n){xr(e,n),xr(e+"Capture",n)}function xr(e,n){for(Bl[e]=n,e=0;e<n.length;e++)zl.add(n[e])}var Ec=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ki={},Ul={};function Sc(e){return Le.call(Ul,e)?!0:Le.call(Ki,e)?!1:Ec.test(e)?Ul[e]=!0:(Ki[e]=!0,!1)}function Xo(e,n,i){if(Sc(n))if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var l=n.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+i)}}function Yo(e,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+i)}}function fn(e,n,i,l){if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(n,i,""+l)}}function Bt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Hl(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function wc(e,n,i){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var c=l.get,d=l.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return c.call(this)},set:function(v){i=""+v,d.call(this,v)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(v){i=""+v},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Io(e){if(!e._valueTracker){var n=Hl(e)?"checked":"value";e._valueTracker=wc(e,n,""+e[n])}}function Ll(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),l="";return e&&(l=Hl(e)?e.checked?"true":"false":e.value),e=l,e!==i?(n.setValue(e),!0):!1}function io(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}}var Ac=/[\n"\\]/g;function Ut(e){return e.replace(Ac,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function ao(e,n,i,l,c,d,v,T){e.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.type=v:e.removeAttribute("type"),n!=null?v==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Bt(n)):e.value!==""+Bt(n)&&(e.value=""+Bt(n)):v!=="submit"&&v!=="reset"||e.removeAttribute("value"),n!=null?Ji(e,v,Bt(n)):i!=null?Ji(e,v,Bt(i)):l!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+Bt(T):e.removeAttribute("name")}function jl(e,n,i,l,c,d,v,T){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),n!=null||i!=null){if(!(d!=="submit"&&d!=="reset"||n!=null)){Io(e);return}i=i!=null?""+Bt(i):"",n=n!=null?""+Bt(n):i,T||n===e.value||(e.value=n),e.defaultValue=n}l=l??c,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=T?e.checked:!!l,e.defaultChecked=!!l,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v),Io(e)}function Ji(e,n,i){n==="number"&&io(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function qn(e,n,i,l){if(e=e.options,n){n={};for(var c=0;c<i.length;c++)n["$"+i[c]]=!0;for(i=0;i<e.length;i++)c=n.hasOwnProperty("$"+e[i].value),e[i].selected!==c&&(e[i].selected=c),c&&l&&(e[i].defaultSelected=!0)}else{for(i=""+Bt(i),n=null,c=0;c<e.length;c++){if(e[c].value===i){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}n!==null||e[c].disabled||(n=e[c])}n!==null&&(n.selected=!0)}}function G0(e,n,i){if(n!=null&&(n=""+Bt(n),n!==e.value&&(e.value=n),i==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=i!=null?""+Bt(i):""}function q0(e,n,i,l){if(n==null){if(l!=null){if(i!=null)throw Error(a(92));if(X(l)){if(1<l.length)throw Error(a(93));l=l[0]}i=l}i==null&&(i=""),n=i}i=Bt(n),e.defaultValue=i,l=e.textContent,l===i&&l!==""&&l!==null&&(e.value=l),Io(e)}function Po(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var UE=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function X0(e,n,i){var l=n.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":l?e.setProperty(n,i):typeof i!="number"||i===0||UE.has(n)?n==="float"?e.cssFloat=i:e[n]=(""+i).trim():e[n]=i+"px"}function Y0(e,n,i){if(n!=null&&typeof n!="object")throw Error(a(62));if(e=e.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||n!=null&&n.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var c in n)l=n[c],n.hasOwnProperty(c)&&i[c]!==l&&X0(e,c,l)}else for(var d in n)n.hasOwnProperty(d)&&X0(e,d,n[d])}function Tc(e){if(e.indexOf("-")===-1)return!1;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 HE=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),LE=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Fl(e){return LE.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xn(){}var Cc=null;function Nc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $o=null,Zo=null;function I0(e){var n=pr(e);if(n&&(e=n.stateNode)){var i=e[At]||null;e:switch(e=n.stateNode,n.type){case"input":if(ao(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),n=i.name,i.type==="radio"&&n!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Ut(""+n)+'"][type="radio"]'),n=0;n<i.length;n++){var l=i[n];if(l!==e&&l.form===e.form){var c=l[At]||null;if(!c)throw Error(a(90));ao(l,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(n=0;n<i.length;n++)l=i[n],l.form===e.form&&Ll(l)}break e;case"textarea":G0(e,i.value,i.defaultValue);break e;case"select":n=i.value,n!=null&&qn(e,!!i.multiple,n,!1)}}}var Rc=!1;function P0(e,n,i){if(Rc)return e(n,i);Rc=!0;try{var l=e(n);return l}finally{if(Rc=!1,($o!==null||Zo!==null)&&(Ts(),$o&&(n=$o,e=Zo,Zo=$o=null,I0(n),e)))for(n=0;n<e.length;n++)I0(e[n])}}function Wi(e,n){var i=e.stateNode;if(i===null)return null;var l=i[At]||null;if(l===null)return null;i=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(a(231,n,typeof i));return i}var Yn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mc=!1;if(Yn)try{var ea={};Object.defineProperty(ea,"passive",{get:function(){Mc=!0}}),window.addEventListener("test",ea,ea),window.removeEventListener("test",ea,ea)}catch{Mc=!1}var vr=null,Dc=null,kl=null;function $0(){if(kl)return kl;var e,n=Dc,i=n.length,l,c="value"in vr?vr.value:vr.textContent,d=c.length;for(e=0;e<i&&n[e]===c[e];e++);var v=i-e;for(l=1;l<=v&&n[i-l]===c[d-l];l++);return kl=c.slice(e,1<l?1-l:void 0)}function Vl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Gl(){return!0}function Z0(){return!1}function Ht(e){function n(i,l,c,d,v){this._reactName=i,this._targetInst=c,this.type=l,this.nativeEvent=d,this.target=v,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(i=e[T],this[T]=i?i(d):d[T]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Gl:Z0,this.isPropagationStopped=Z0,this}return g(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Gl)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Gl)},persist:function(){},isPersistent:Gl}),n}var lo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ql=Ht(lo),ta=g({},lo,{view:0,detail:0}),jE=Ht(ta),Oc,zc,na,Xl=g({},ta,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==na&&(na&&e.type==="mousemove"?(Oc=e.screenX-na.screenX,zc=e.screenY-na.screenY):zc=Oc=0,na=e),Oc)},movementY:function(e){return"movementY"in e?e.movementY:zc}}),Q0=Ht(Xl),FE=g({},Xl,{dataTransfer:0}),kE=Ht(FE),VE=g({},ta,{relatedTarget:0}),Bc=Ht(VE),GE=g({},lo,{animationName:0,elapsedTime:0,pseudoElement:0}),qE=Ht(GE),XE=g({},lo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),YE=Ht(XE),IE=g({},lo,{data:0}),K0=Ht(IE),PE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$E={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ZE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function QE(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=ZE[e])?!!n[e]:!1}function Uc(){return QE}var KE=g({},ta,{key:function(e){if(e.key){var n=PE[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Vl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$E[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uc,charCode:function(e){return e.type==="keypress"?Vl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Vl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),JE=Ht(KE),WE=g({},Xl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),J0=Ht(WE),e2=g({},ta,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uc}),t2=Ht(e2),n2=g({},lo,{propertyName:0,elapsedTime:0,pseudoElement:0}),r2=Ht(n2),o2=g({},Xl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),i2=Ht(o2),a2=g({},lo,{newState:0,oldState:0}),l2=Ht(a2),s2=[9,13,27,32],Hc=Yn&&"CompositionEvent"in window,ra=null;Yn&&"documentMode"in document&&(ra=document.documentMode);var u2=Yn&&"TextEvent"in window&&!ra,W0=Yn&&(!Hc||ra&&8<ra&&11>=ra),em=" ",tm=!1;function nm(e,n){switch(e){case"keyup":return s2.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qo=!1;function c2(e,n){switch(e){case"compositionend":return rm(n);case"keypress":return n.which!==32?null:(tm=!0,em);case"textInput":return e=n.data,e===em&&tm?null:e;default:return null}}function f2(e,n){if(Qo)return e==="compositionend"||!Hc&&nm(e,n)?(e=$0(),kl=Dc=vr=null,Qo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return W0&&n.locale!=="ko"?null:n.data;default:return null}}var d2={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function om(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!d2[e.type]:n==="textarea"}function im(e,n,i,l){$o?Zo?Zo.push(l):Zo=[l]:$o=l,n=zs(n,"onChange"),0<n.length&&(i=new ql("onChange","change",null,i,l),e.push({event:i,listeners:n}))}var oa=null,ia=null;function h2(e){Vg(e,0)}function Yl(e){var n=gr(e);if(Ll(n))return e}function am(e,n){if(e==="change")return n}var lm=!1;if(Yn){var Lc;if(Yn){var jc="oninput"in document;if(!jc){var sm=document.createElement("div");sm.setAttribute("oninput","return;"),jc=typeof sm.oninput=="function"}Lc=jc}else Lc=!1;lm=Lc&&(!document.documentMode||9<document.documentMode)}function um(){oa&&(oa.detachEvent("onpropertychange",cm),ia=oa=null)}function cm(e){if(e.propertyName==="value"&&Yl(ia)){var n=[];im(n,ia,e,Nc(e)),P0(h2,n)}}function m2(e,n,i){e==="focusin"?(um(),oa=n,ia=i,oa.attachEvent("onpropertychange",cm)):e==="focusout"&&um()}function p2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yl(ia)}function g2(e,n){if(e==="click")return Yl(n)}function y2(e,n){if(e==="input"||e==="change")return Yl(n)}function x2(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var qt=typeof Object.is=="function"?Object.is:x2;function aa(e,n){if(qt(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var i=Object.keys(e),l=Object.keys(n);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var c=i[l];if(!Le.call(n,c)||!qt(e[c],n[c]))return!1}return!0}function fm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dm(e,n){var i=fm(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=n&&l>=n)return{node:i,offset:n-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=fm(i)}}function hm(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?hm(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function mm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=io(e.document);n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=io(e.document)}return n}function Fc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var v2=Yn&&"documentMode"in document&&11>=document.documentMode,Ko=null,kc=null,la=null,Vc=!1;function pm(e,n,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Vc||Ko==null||Ko!==io(l)||(l=Ko,"selectionStart"in l&&Fc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),la&&aa(la,l)||(la=l,l=zs(kc,"onSelect"),0<l.length&&(n=new ql("onSelect","select",null,n,i),e.push({event:n,listeners:l}),n.target=Ko)))}function so(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var Jo={animationend:so("Animation","AnimationEnd"),animationiteration:so("Animation","AnimationIteration"),animationstart:so("Animation","AnimationStart"),transitionrun:so("Transition","TransitionRun"),transitionstart:so("Transition","TransitionStart"),transitioncancel:so("Transition","TransitionCancel"),transitionend:so("Transition","TransitionEnd")},Gc={},gm={};Yn&&(gm=document.createElement("div").style,"AnimationEvent"in window||(delete Jo.animationend.animation,delete Jo.animationiteration.animation,delete Jo.animationstart.animation),"TransitionEvent"in window||delete Jo.transitionend.transition);function uo(e){if(Gc[e])return Gc[e];if(!Jo[e])return e;var n=Jo[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in gm)return Gc[e]=n[i];return e}var ym=uo("animationend"),xm=uo("animationiteration"),vm=uo("animationstart"),b2=uo("transitionrun"),_2=uo("transitionstart"),E2=uo("transitioncancel"),bm=uo("transitionend"),_m=new Map,qc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");qc.push("scrollEnd");function dn(e,n){_m.set(e,n),Gn(n,[e])}var Il=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},en=[],Wo=0,Xc=0;function Pl(){for(var e=Wo,n=Xc=Wo=0;n<e;){var i=en[n];en[n++]=null;var l=en[n];en[n++]=null;var c=en[n];en[n++]=null;var d=en[n];if(en[n++]=null,l!==null&&c!==null){var v=l.pending;v===null?c.next=c:(c.next=v.next,v.next=c),l.pending=c}d!==0&&Em(i,c,d)}}function $l(e,n,i,l){en[Wo++]=e,en[Wo++]=n,en[Wo++]=i,en[Wo++]=l,Xc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Yc(e,n,i,l){return $l(e,n,i,l),Zl(e)}function co(e,n){return $l(e,null,null,n),Zl(e)}function Em(e,n,i){e.lanes|=i;var l=e.alternate;l!==null&&(l.lanes|=i);for(var c=!1,d=e.return;d!==null;)d.childLanes|=i,l=d.alternate,l!==null&&(l.childLanes|=i),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&n!==null&&(c=31-Mt(i),e=d.hiddenUpdates,l=e[c],l===null?e[c]=[n]:l.push(n),n.lane=i|536870912),d):null}function Zl(e){if(50<Ra)throw Ra=0,td=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var ei={};function S2(e,n,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xt(e,n,i,l){return new S2(e,n,i,l)}function Ic(e){return e=e.prototype,!(!e||!e.isReactComponent)}function In(e,n){var i=e.alternate;return i===null?(i=Xt(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Sm(e,n){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,n=i.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Ql(e,n,i,l,c,d){var v=0;if(l=e,typeof e=="function")Ic(e)&&(v=1);else if(typeof e=="string")v=NS(e,i,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case I:return e=Xt(31,i,n,c),e.elementType=I,e.lanes=d,e;case E:return fo(i.children,c,d,n);case C:v=8,c|=24;break;case w:return e=Xt(12,i,n,c|2),e.elementType=w,e.lanes=d,e;case O:return e=Xt(13,i,n,c),e.elementType=O,e.lanes=d,e;case z:return e=Xt(19,i,n,c),e.elementType=z,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case S:v=10;break e;case D:v=9;break e;case N:v=11;break e;case B:v=14;break e;case q:v=16,l=null;break e}v=29,i=Error(a(130,e===null?"null":typeof e,"")),l=null}return n=Xt(v,i,n,c),n.elementType=e,n.type=l,n.lanes=d,n}function fo(e,n,i,l){return e=Xt(7,e,l,n),e.lanes=i,e}function Pc(e,n,i){return e=Xt(6,e,null,n),e.lanes=i,e}function wm(e){var n=Xt(18,null,null,0);return n.stateNode=e,n}function $c(e,n,i){return n=Xt(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Am=new WeakMap;function tn(e,n){if(typeof e=="object"&&e!==null){var i=Am.get(e);return i!==void 0?i:(n={value:e,source:n,stack:je(n)},Am.set(e,n),n)}return{value:e,source:n,stack:je(n)}}var ti=[],ni=0,Kl=null,sa=0,nn=[],rn=0,br=null,Tn=1,Cn="";function Pn(e,n){ti[ni++]=sa,ti[ni++]=Kl,Kl=e,sa=n}function Tm(e,n,i){nn[rn++]=Tn,nn[rn++]=Cn,nn[rn++]=br,br=e;var l=Tn;e=Cn;var c=32-Mt(l)-1;l&=~(1<<c),i+=1;var d=32-Mt(n)+c;if(30<d){var v=c-c%5;d=(l&(1<<v)-1).toString(32),l>>=v,c-=v,Tn=1<<32-Mt(n)+c|i<<c|l,Cn=d+e}else Tn=1<<d|i<<c|l,Cn=e}function Zc(e){e.return!==null&&(Pn(e,1),Tm(e,1,0))}function Qc(e){for(;e===Kl;)Kl=ti[--ni],ti[ni]=null,sa=ti[--ni],ti[ni]=null;for(;e===br;)br=nn[--rn],nn[rn]=null,Cn=nn[--rn],nn[rn]=null,Tn=nn[--rn],nn[rn]=null}function Cm(e,n){nn[rn++]=Tn,nn[rn++]=Cn,nn[rn++]=br,Tn=n.id,Cn=n.overflow,br=e}var _t=null,Ze=null,Be=!1,_r=null,on=!1,Kc=Error(a(519));function Er(e){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ua(tn(n,e)),Kc}function Nm(e){var n=e.stateNode,i=e.type,l=e.memoizedProps;switch(n[yt]=e,n[At]=l,i){case"dialog":Me("cancel",n),Me("close",n);break;case"iframe":case"object":case"embed":Me("load",n);break;case"video":case"audio":for(i=0;i<Da.length;i++)Me(Da[i],n);break;case"source":Me("error",n);break;case"img":case"image":case"link":Me("error",n),Me("load",n);break;case"details":Me("toggle",n);break;case"input":Me("invalid",n),jl(n,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Me("invalid",n);break;case"textarea":Me("invalid",n),q0(n,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||n.textContent===""+i||l.suppressHydrationWarning===!0||Yg(n.textContent,i)?(l.popover!=null&&(Me("beforetoggle",n),Me("toggle",n)),l.onScroll!=null&&Me("scroll",n),l.onScrollEnd!=null&&Me("scrollend",n),l.onClick!=null&&(n.onclick=Xn),n=!0):n=!1,n||Er(e,!0)}function Rm(e){for(_t=e.return;_t;)switch(_t.tag){case 5:case 31:case 13:on=!1;return;case 27:case 3:on=!0;return;default:_t=_t.return}}function ri(e){if(e!==_t)return!1;if(!Be)return Rm(e),Be=!0,!1;var n=e.tag,i;if((i=n!==3&&n!==27)&&((i=n===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||gd(e.type,e.memoizedProps)),i=!i),i&&Ze&&Er(e),Rm(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Ze=ey(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Ze=ey(e)}else n===27?(n=Ze,Hr(e.type)?(e=_d,_d=null,Ze=e):Ze=n):Ze=_t?ln(e.stateNode.nextSibling):null;return!0}function ho(){Ze=_t=null,Be=!1}function Jc(){var e=_r;return e!==null&&(kt===null?kt=e:kt.push.apply(kt,e),_r=null),e}function ua(e){_r===null?_r=[e]:_r.push(e)}var Wc=M(null),mo=null,$n=null;function Sr(e,n,i){W(Wc,n._currentValue),n._currentValue=i}function Zn(e){e._currentValue=Wc.current,k(Wc)}function ef(e,n,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===i)break;e=e.return}}function tf(e,n,i,l){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var v=c.child;d=d.firstContext;e:for(;d!==null;){var T=d;d=c;for(var L=0;L<n.length;L++)if(T.context===n[L]){d.lanes|=i,T=d.alternate,T!==null&&(T.lanes|=i),ef(d.return,i,e),l||(v=null);break e}d=T.next}}else if(c.tag===18){if(v=c.return,v===null)throw Error(a(341));v.lanes|=i,d=v.alternate,d!==null&&(d.lanes|=i),ef(v,i,e),v=null}else v=c.child;if(v!==null)v.return=c;else for(v=c;v!==null;){if(v===e){v=null;break}if(c=v.sibling,c!==null){c.return=v.return,v=c;break}v=v.return}c=v}}function oi(e,n,i,l){e=null;for(var c=n,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var v=c.alternate;if(v===null)throw Error(a(387));if(v=v.memoizedProps,v!==null){var T=c.type;qt(c.pendingProps.value,v.value)||(e!==null?e.push(T):e=[T])}}else if(c===ce.current){if(v=c.alternate,v===null)throw Error(a(387));v.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Ha):e=[Ha])}c=c.return}e!==null&&tf(n,e,i,l),n.flags|=262144}function Jl(e){for(e=e.firstContext;e!==null;){if(!qt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function po(e){mo=e,$n=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Et(e){return Mm(mo,e)}function Wl(e,n){return mo===null&&po(e),Mm(e,n)}function Mm(e,n){var i=n._currentValue;if(n={context:n,memoizedValue:i,next:null},$n===null){if(e===null)throw Error(a(308));$n=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else $n=$n.next=n;return i}var w2=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(i,l){e.push(l)}};this.abort=function(){n.aborted=!0,e.forEach(function(i){return i()})}},A2=t.unstable_scheduleCallback,T2=t.unstable_NormalPriority,ct={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nf(){return{controller:new w2,data:new Map,refCount:0}}function ca(e){e.refCount--,e.refCount===0&&A2(T2,function(){e.controller.abort()})}var fa=null,rf=0,ii=0,ai=null;function C2(e,n){if(fa===null){var i=fa=[];rf=0,ii=ld(),ai={status:"pending",value:void 0,then:function(l){i.push(l)}}}return rf++,n.then(Dm,Dm),n}function Dm(){if(--rf===0&&fa!==null){ai!==null&&(ai.status="fulfilled");var e=fa;fa=null,ii=0,ai=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function N2(e,n){var i=[],l={status:"pending",value:null,reason:null,then:function(c){i.push(c)}};return e.then(function(){l.status="fulfilled",l.value=n;for(var c=0;c<i.length;c++)(0,i[c])(n)},function(c){for(l.status="rejected",l.reason=c,c=0;c<i.length;c++)(0,i[c])(void 0)}),l}var Om=R.S;R.S=function(e,n){pg=at(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&C2(e,n),Om!==null&&Om(e,n)};var go=M(null);function of(){var e=go.current;return e!==null?e:Pe.pooledCache}function es(e,n){n===null?W(go,go.current):W(go,n.pool)}function zm(){var e=of();return e===null?null:{parent:ct._currentValue,pool:e}}var li=Error(a(460)),af=Error(a(474)),ts=Error(a(542)),ns={then:function(){}};function Bm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Um(e,n,i){switch(i=e[i],i===void 0?e.push(n):i!==n&&(n.then(Xn,Xn),n=i),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Lm(e),e;default:if(typeof n.status=="string")n.then(Xn,Xn);else{if(e=Pe,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=n,e.status="pending",e.then(function(l){if(n.status==="pending"){var c=n;c.status="fulfilled",c.value=l}},function(l){if(n.status==="pending"){var c=n;c.status="rejected",c.reason=l}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Lm(e),e}throw xo=n,li}}function yo(e){try{var n=e._init;return n(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(xo=i,li):i}}var xo=null;function Hm(){if(xo===null)throw Error(a(459));var e=xo;return xo=null,e}function Lm(e){if(e===li||e===ts)throw Error(a(483))}var si=null,da=0;function rs(e){var n=da;return da+=1,si===null&&(si=[]),Um(si,e,n)}function ha(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function os(e,n){throw n.$$typeof===x?Error(a(525)):(e=Object.prototype.toString.call(n),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function jm(e){function n(Y,G){if(e){var Z=Y.deletions;Z===null?(Y.deletions=[G],Y.flags|=16):Z.push(G)}}function i(Y,G){if(!e)return null;for(;G!==null;)n(Y,G),G=G.sibling;return null}function l(Y){for(var G=new Map;Y!==null;)Y.key!==null?G.set(Y.key,Y):G.set(Y.index,Y),Y=Y.sibling;return G}function c(Y,G){return Y=In(Y,G),Y.index=0,Y.sibling=null,Y}function d(Y,G,Z){return Y.index=Z,e?(Z=Y.alternate,Z!==null?(Z=Z.index,Z<G?(Y.flags|=67108866,G):Z):(Y.flags|=67108866,G)):(Y.flags|=1048576,G)}function v(Y){return e&&Y.alternate===null&&(Y.flags|=67108866),Y}function T(Y,G,Z,ie){return G===null||G.tag!==6?(G=Pc(Z,Y.mode,ie),G.return=Y,G):(G=c(G,Z),G.return=Y,G)}function L(Y,G,Z,ie){var ve=Z.type;return ve===E?re(Y,G,Z.props.children,ie,Z.key):G!==null&&(G.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===q&&yo(ve)===G.type)?(G=c(G,Z.props),ha(G,Z),G.return=Y,G):(G=Ql(Z.type,Z.key,Z.props,null,Y.mode,ie),ha(G,Z),G.return=Y,G)}function Q(Y,G,Z,ie){return G===null||G.tag!==4||G.stateNode.containerInfo!==Z.containerInfo||G.stateNode.implementation!==Z.implementation?(G=$c(Z,Y.mode,ie),G.return=Y,G):(G=c(G,Z.children||[]),G.return=Y,G)}function re(Y,G,Z,ie,ve){return G===null||G.tag!==7?(G=fo(Z,Y.mode,ie,ve),G.return=Y,G):(G=c(G,Z),G.return=Y,G)}function le(Y,G,Z){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Pc(""+G,Y.mode,Z),G.return=Y,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case _:return Z=Ql(G.type,G.key,G.props,null,Y.mode,Z),ha(Z,G),Z.return=Y,Z;case b:return G=$c(G,Y.mode,Z),G.return=Y,G;case q:return G=yo(G),le(Y,G,Z)}if(X(G)||$(G))return G=fo(G,Y.mode,Z,null),G.return=Y,G;if(typeof G.then=="function")return le(Y,rs(G),Z);if(G.$$typeof===S)return le(Y,Wl(Y,G),Z);os(Y,G)}return null}function K(Y,G,Z,ie){var ve=G!==null?G.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return ve!==null?null:T(Y,G,""+Z,ie);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case _:return Z.key===ve?L(Y,G,Z,ie):null;case b:return Z.key===ve?Q(Y,G,Z,ie):null;case q:return Z=yo(Z),K(Y,G,Z,ie)}if(X(Z)||$(Z))return ve!==null?null:re(Y,G,Z,ie,null);if(typeof Z.then=="function")return K(Y,G,rs(Z),ie);if(Z.$$typeof===S)return K(Y,G,Wl(Y,Z),ie);os(Y,Z)}return null}function J(Y,G,Z,ie,ve){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Y=Y.get(Z)||null,T(G,Y,""+ie,ve);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case _:return Y=Y.get(ie.key===null?Z:ie.key)||null,L(G,Y,ie,ve);case b:return Y=Y.get(ie.key===null?Z:ie.key)||null,Q(G,Y,ie,ve);case q:return ie=yo(ie),J(Y,G,Z,ie,ve)}if(X(ie)||$(ie))return Y=Y.get(Z)||null,re(G,Y,ie,ve,null);if(typeof ie.then=="function")return J(Y,G,Z,rs(ie),ve);if(ie.$$typeof===S)return J(Y,G,Z,Wl(G,ie),ve);os(G,ie)}return null}function pe(Y,G,Z,ie){for(var ve=null,Fe=null,ye=G,Ne=G=0,Oe=null;ye!==null&&Ne<Z.length;Ne++){ye.index>Ne?(Oe=ye,ye=null):Oe=ye.sibling;var ke=K(Y,ye,Z[Ne],ie);if(ke===null){ye===null&&(ye=Oe);break}e&&ye&&ke.alternate===null&&n(Y,ye),G=d(ke,G,Ne),Fe===null?ve=ke:Fe.sibling=ke,Fe=ke,ye=Oe}if(Ne===Z.length)return i(Y,ye),Be&&Pn(Y,Ne),ve;if(ye===null){for(;Ne<Z.length;Ne++)ye=le(Y,Z[Ne],ie),ye!==null&&(G=d(ye,G,Ne),Fe===null?ve=ye:Fe.sibling=ye,Fe=ye);return Be&&Pn(Y,Ne),ve}for(ye=l(ye);Ne<Z.length;Ne++)Oe=J(ye,Y,Ne,Z[Ne],ie),Oe!==null&&(e&&Oe.alternate!==null&&ye.delete(Oe.key===null?Ne:Oe.key),G=d(Oe,G,Ne),Fe===null?ve=Oe:Fe.sibling=Oe,Fe=Oe);return e&&ye.forEach(function(Vr){return n(Y,Vr)}),Be&&Pn(Y,Ne),ve}function _e(Y,G,Z,ie){if(Z==null)throw Error(a(151));for(var ve=null,Fe=null,ye=G,Ne=G=0,Oe=null,ke=Z.next();ye!==null&&!ke.done;Ne++,ke=Z.next()){ye.index>Ne?(Oe=ye,ye=null):Oe=ye.sibling;var Vr=K(Y,ye,ke.value,ie);if(Vr===null){ye===null&&(ye=Oe);break}e&&ye&&Vr.alternate===null&&n(Y,ye),G=d(Vr,G,Ne),Fe===null?ve=Vr:Fe.sibling=Vr,Fe=Vr,ye=Oe}if(ke.done)return i(Y,ye),Be&&Pn(Y,Ne),ve;if(ye===null){for(;!ke.done;Ne++,ke=Z.next())ke=le(Y,ke.value,ie),ke!==null&&(G=d(ke,G,Ne),Fe===null?ve=ke:Fe.sibling=ke,Fe=ke);return Be&&Pn(Y,Ne),ve}for(ye=l(ye);!ke.done;Ne++,ke=Z.next())ke=J(ye,Y,Ne,ke.value,ie),ke!==null&&(e&&ke.alternate!==null&&ye.delete(ke.key===null?Ne:ke.key),G=d(ke,G,Ne),Fe===null?ve=ke:Fe.sibling=ke,Fe=ke);return e&&ye.forEach(function(FS){return n(Y,FS)}),Be&&Pn(Y,Ne),ve}function Ie(Y,G,Z,ie){if(typeof Z=="object"&&Z!==null&&Z.type===E&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case _:e:{for(var ve=Z.key;G!==null;){if(G.key===ve){if(ve=Z.type,ve===E){if(G.tag===7){i(Y,G.sibling),ie=c(G,Z.props.children),ie.return=Y,Y=ie;break e}}else if(G.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===q&&yo(ve)===G.type){i(Y,G.sibling),ie=c(G,Z.props),ha(ie,Z),ie.return=Y,Y=ie;break e}i(Y,G);break}else n(Y,G);G=G.sibling}Z.type===E?(ie=fo(Z.props.children,Y.mode,ie,Z.key),ie.return=Y,Y=ie):(ie=Ql(Z.type,Z.key,Z.props,null,Y.mode,ie),ha(ie,Z),ie.return=Y,Y=ie)}return v(Y);case b:e:{for(ve=Z.key;G!==null;){if(G.key===ve)if(G.tag===4&&G.stateNode.containerInfo===Z.containerInfo&&G.stateNode.implementation===Z.implementation){i(Y,G.sibling),ie=c(G,Z.children||[]),ie.return=Y,Y=ie;break e}else{i(Y,G);break}else n(Y,G);G=G.sibling}ie=$c(Z,Y.mode,ie),ie.return=Y,Y=ie}return v(Y);case q:return Z=yo(Z),Ie(Y,G,Z,ie)}if(X(Z))return pe(Y,G,Z,ie);if($(Z)){if(ve=$(Z),typeof ve!="function")throw Error(a(150));return Z=ve.call(Z),_e(Y,G,Z,ie)}if(typeof Z.then=="function")return Ie(Y,G,rs(Z),ie);if(Z.$$typeof===S)return Ie(Y,G,Wl(Y,Z),ie);os(Y,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,G!==null&&G.tag===6?(i(Y,G.sibling),ie=c(G,Z),ie.return=Y,Y=ie):(i(Y,G),ie=Pc(Z,Y.mode,ie),ie.return=Y,Y=ie),v(Y)):i(Y,G)}return function(Y,G,Z,ie){try{da=0;var ve=Ie(Y,G,Z,ie);return si=null,ve}catch(ye){if(ye===li||ye===ts)throw ye;var Fe=Xt(29,ye,null,Y.mode);return Fe.lanes=ie,Fe.return=Y,Fe}}}var vo=jm(!0),Fm=jm(!1),wr=!1;function lf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sf(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ar(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Tr(e,n,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ve&2)!==0){var c=l.pending;return c===null?n.next=n:(n.next=c.next,c.next=n),l.pending=n,n=Zl(e),Em(e,null,i),n}return $l(e,l,n,i),Zl(e)}function ma(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194048)!==0)){var l=n.lanes;l&=e.pendingLanes,i|=l,n.lanes=i,Cl(e,i)}}function uf(e,n){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var c=null,d=null;if(i=i.firstBaseUpdate,i!==null){do{var v={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};d===null?c=d=v:d=d.next=v,i=i.next}while(i!==null);d===null?c=d=n:d=d.next=n}else c=d=n;i={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:l.shared,callbacks:l.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}var cf=!1;function pa(){if(cf){var e=ai;if(e!==null)throw e}}function ga(e,n,i,l){cf=!1;var c=e.updateQueue;wr=!1;var d=c.firstBaseUpdate,v=c.lastBaseUpdate,T=c.shared.pending;if(T!==null){c.shared.pending=null;var L=T,Q=L.next;L.next=null,v===null?d=Q:v.next=Q,v=L;var re=e.alternate;re!==null&&(re=re.updateQueue,T=re.lastBaseUpdate,T!==v&&(T===null?re.firstBaseUpdate=Q:T.next=Q,re.lastBaseUpdate=L))}if(d!==null){var le=c.baseState;v=0,re=Q=L=null,T=d;do{var K=T.lane&-536870913,J=K!==T.lane;if(J?(De&K)===K:(l&K)===K){K!==0&&K===ii&&(cf=!0),re!==null&&(re=re.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var pe=e,_e=T;K=n;var Ie=i;switch(_e.tag){case 1:if(pe=_e.payload,typeof pe=="function"){le=pe.call(Ie,le,K);break e}le=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=_e.payload,K=typeof pe=="function"?pe.call(Ie,le,K):pe,K==null)break e;le=g({},le,K);break e;case 2:wr=!0}}K=T.callback,K!==null&&(e.flags|=64,J&&(e.flags|=8192),J=c.callbacks,J===null?c.callbacks=[K]:J.push(K))}else J={lane:K,tag:T.tag,payload:T.payload,callback:T.callback,next:null},re===null?(Q=re=J,L=le):re=re.next=J,v|=K;if(T=T.next,T===null){if(T=c.shared.pending,T===null)break;J=T,T=J.next,J.next=null,c.lastBaseUpdate=J,c.shared.pending=null}}while(!0);re===null&&(L=le),c.baseState=L,c.firstBaseUpdate=Q,c.lastBaseUpdate=re,d===null&&(c.shared.lanes=0),Dr|=v,e.lanes=v,e.memoizedState=le}}function km(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function Vm(e,n){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)km(i[e],n)}var ui=M(null),is=M(0);function Gm(e,n){e=or,W(is,e),W(ui,n),or=e|n.baseLanes}function ff(){W(is,or),W(ui,ui.current)}function df(){or=is.current,k(ui),k(is)}var Yt=M(null),an=null;function Cr(e){var n=e.alternate;W(lt,lt.current&1),W(Yt,e),an===null&&(n===null||ui.current!==null||n.memoizedState!==null)&&(an=e)}function hf(e){W(lt,lt.current),W(Yt,e),an===null&&(an=e)}function qm(e){e.tag===22?(W(lt,lt.current),W(Yt,e),an===null&&(an=e)):Nr()}function Nr(){W(lt,lt.current),W(Yt,Yt.current)}function It(e){k(Yt),an===e&&(an=null),k(lt)}var lt=M(0);function as(e){for(var n=e;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||vd(i)||bd(i)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Qn=0,Te=null,Xe=null,ft=null,ls=!1,ci=!1,bo=!1,ss=0,ya=0,fi=null,R2=0;function rt(){throw Error(a(321))}function mf(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!qt(e[i],n[i]))return!1;return!0}function pf(e,n,i,l,c,d){return Qn=d,Te=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,R.H=e===null||e.memoizedState===null?Tp:Mf,bo=!1,d=i(l,c),bo=!1,ci&&(d=Ym(n,i,l,c)),Xm(e),d}function Xm(e){R.H=ba;var n=Xe!==null&&Xe.next!==null;if(Qn=0,ft=Xe=Te=null,ls=!1,ya=0,fi=null,n)throw Error(a(300));e===null||dt||(e=e.dependencies,e!==null&&Jl(e)&&(dt=!0))}function Ym(e,n,i,l){Te=e;var c=0;do{if(ci&&(fi=null),ya=0,ci=!1,25<=c)throw Error(a(301));if(c+=1,ft=Xe=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}R.H=Cp,d=n(i,l)}while(ci);return d}function M2(){var e=R.H,n=e.useState()[0];return n=typeof n.then=="function"?xa(n):n,e=e.useState()[0],(Xe!==null?Xe.memoizedState:null)!==e&&(Te.flags|=1024),n}function gf(){var e=ss!==0;return ss=0,e}function yf(e,n,i){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~i}function xf(e){if(ls){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}ls=!1}Qn=0,ft=Xe=Te=null,ci=!1,ya=ss=0,fi=null}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ft===null?Te.memoizedState=ft=e:ft=ft.next=e,ft}function st(){if(Xe===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var n=ft===null?Te.memoizedState:ft.next;if(n!==null)ft=n,Xe=e;else{if(e===null)throw Te.alternate===null?Error(a(467)):Error(a(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},ft===null?Te.memoizedState=ft=e:ft=ft.next=e}return ft}function us(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xa(e){var n=ya;return ya+=1,fi===null&&(fi=[]),e=Um(fi,e,n),n=Te,(ft===null?n.memoizedState:ft.next)===null&&(n=n.alternate,R.H=n===null||n.memoizedState===null?Tp:Mf),e}function cs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return xa(e);if(e.$$typeof===S)return Et(e)}throw Error(a(438,String(e)))}function vf(e){var n=null,i=Te.updateQueue;if(i!==null&&(n=i.memoCache),n==null){var l=Te.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(n={data:l.data.map(function(c){return c.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),i===null&&(i=us(),Te.updateQueue=i),i.memoCache=n,i=n.data[n.index],i===void 0)for(i=n.data[n.index]=Array(e),l=0;l<e;l++)i[l]=ae;return n.index++,i}function Kn(e,n){return typeof n=="function"?n(e):n}function fs(e){var n=st();return bf(n,Xe,e)}function bf(e,n,i){var l=e.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=i;var c=e.baseQueue,d=l.pending;if(d!==null){if(c!==null){var v=c.next;c.next=d.next,d.next=v}n.baseQueue=c=d,l.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{n=c.next;var T=v=null,L=null,Q=n,re=!1;do{var le=Q.lane&-536870913;if(le!==Q.lane?(De&le)===le:(Qn&le)===le){var K=Q.revertLane;if(K===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),le===ii&&(re=!0);else if((Qn&K)===K){Q=Q.next,K===ii&&(re=!0);continue}else le={lane:0,revertLane:Q.revertLane,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},L===null?(T=L=le,v=d):L=L.next=le,Te.lanes|=K,Dr|=K;le=Q.action,bo&&i(d,le),d=Q.hasEagerState?Q.eagerState:i(d,le)}else K={lane:le,revertLane:Q.revertLane,gesture:Q.gesture,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},L===null?(T=L=K,v=d):L=L.next=K,Te.lanes|=le,Dr|=le;Q=Q.next}while(Q!==null&&Q!==n);if(L===null?v=d:L.next=T,!qt(d,e.memoizedState)&&(dt=!0,re&&(i=ai,i!==null)))throw i;e.memoizedState=d,e.baseState=v,e.baseQueue=L,l.lastRenderedState=d}return c===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function _f(e){var n=st(),i=n.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=e;var l=i.dispatch,c=i.pending,d=n.memoizedState;if(c!==null){i.pending=null;var v=c=c.next;do d=e(d,v.action),v=v.next;while(v!==c);qt(d,n.memoizedState)||(dt=!0),n.memoizedState=d,n.baseQueue===null&&(n.baseState=d),i.lastRenderedState=d}return[d,l]}function Im(e,n,i){var l=Te,c=st(),d=Be;if(d){if(i===void 0)throw Error(a(407));i=i()}else i=n();var v=!qt((Xe||c).memoizedState,i);if(v&&(c.memoizedState=i,dt=!0),c=c.queue,wf(Zm.bind(null,l,c,e),[e]),c.getSnapshot!==n||v||ft!==null&&ft.memoizedState.tag&1){if(l.flags|=2048,di(9,{destroy:void 0},$m.bind(null,l,c,i,n),null),Pe===null)throw Error(a(349));d||(Qn&127)!==0||Pm(l,n,i)}return i}function Pm(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=Te.updateQueue,n===null?(n=us(),Te.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function $m(e,n,i,l){n.value=i,n.getSnapshot=l,Qm(n)&&Km(e)}function Zm(e,n,i){return i(function(){Qm(n)&&Km(e)})}function Qm(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!qt(e,i)}catch{return!0}}function Km(e){var n=co(e,2);n!==null&&Vt(n,e,2)}function Ef(e){var n=Dt();if(typeof e=="function"){var i=e;if(e=i(),bo){wn(!0);try{i()}finally{wn(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:e},n}function Jm(e,n,i,l){return e.baseState=i,bf(e,Xe,typeof l=="function"?l:Kn)}function D2(e,n,i,l,c){if(ms(e))throw Error(a(485));if(e=n.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){d.listeners.push(v)}};R.T!==null?i(!0):d.isTransition=!1,l(d),i=n.pending,i===null?(d.next=n.pending=d,Wm(n,d)):(d.next=i.next,n.pending=i.next=d)}}function Wm(e,n){var i=n.action,l=n.payload,c=e.state;if(n.isTransition){var d=R.T,v={};R.T=v;try{var T=i(c,l),L=R.S;L!==null&&L(v,T),ep(e,n,T)}catch(Q){Sf(e,n,Q)}finally{d!==null&&v.types!==null&&(d.types=v.types),R.T=d}}else try{d=i(c,l),ep(e,n,d)}catch(Q){Sf(e,n,Q)}}function ep(e,n,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){tp(e,n,l)},function(l){return Sf(e,n,l)}):tp(e,n,i)}function tp(e,n,i){n.status="fulfilled",n.value=i,np(n),e.state=i,n=e.pending,n!==null&&(i=n.next,i===n?e.pending=null:(i=i.next,n.next=i,Wm(e,i)))}function Sf(e,n,i){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do n.status="rejected",n.reason=i,np(n),n=n.next;while(n!==l)}e.action=null}function np(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function rp(e,n){return n}function op(e,n){if(Be){var i=Pe.formState;if(i!==null){e:{var l=Te;if(Be){if(Ze){t:{for(var c=Ze,d=on;c.nodeType!==8;){if(!d){c=null;break t}if(c=ln(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){Ze=ln(c.nextSibling),l=c.data==="F!";break e}}Er(l)}l=!1}l&&(n=i[0])}}return i=Dt(),i.memoizedState=i.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rp,lastRenderedState:n},i.queue=l,i=Sp.bind(null,Te,l),l.dispatch=i,l=Ef(!1),d=Rf.bind(null,Te,!1,l.queue),l=Dt(),c={state:n,dispatch:null,action:e,pending:null},l.queue=c,i=D2.bind(null,Te,c,d,i),c.dispatch=i,l.memoizedState=e,[n,i,!1]}function ip(e){var n=st();return ap(n,Xe,e)}function ap(e,n,i){if(n=bf(e,n,rp)[0],e=fs(Kn)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var l=xa(n)}catch(v){throw v===li?ts:v}else l=n;n=st();var c=n.queue,d=c.dispatch;return i!==n.memoizedState&&(Te.flags|=2048,di(9,{destroy:void 0},O2.bind(null,c,i),null)),[l,d,e]}function O2(e,n){e.action=n}function lp(e){var n=st(),i=Xe;if(i!==null)return ap(n,i,e);st(),n=n.memoizedState,i=st();var l=i.queue.dispatch;return i.memoizedState=e,[n,l,!1]}function di(e,n,i,l){return e={tag:e,create:i,deps:l,inst:n,next:null},n=Te.updateQueue,n===null&&(n=us(),Te.updateQueue=n),i=n.lastEffect,i===null?n.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,n.lastEffect=e),e}function sp(){return st().memoizedState}function ds(e,n,i,l){var c=Dt();Te.flags|=e,c.memoizedState=di(1|n,{destroy:void 0},i,l===void 0?null:l)}function hs(e,n,i,l){var c=st();l=l===void 0?null:l;var d=c.memoizedState.inst;Xe!==null&&l!==null&&mf(l,Xe.memoizedState.deps)?c.memoizedState=di(n,d,i,l):(Te.flags|=e,c.memoizedState=di(1|n,d,i,l))}function up(e,n){ds(8390656,8,e,n)}function wf(e,n){hs(2048,8,e,n)}function z2(e){Te.flags|=4;var n=Te.updateQueue;if(n===null)n=us(),Te.updateQueue=n,n.events=[e];else{var i=n.events;i===null?n.events=[e]:i.push(e)}}function cp(e){var n=st().memoizedState;return z2({ref:n,nextImpl:e}),function(){if((Ve&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}function fp(e,n){return hs(4,2,e,n)}function dp(e,n){return hs(4,4,e,n)}function hp(e,n){if(typeof n=="function"){e=e();var i=n(e);return function(){typeof i=="function"?i():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function mp(e,n,i){i=i!=null?i.concat([e]):null,hs(4,4,hp.bind(null,n,e),i)}function Af(){}function pp(e,n){var i=st();n=n===void 0?null:n;var l=i.memoizedState;return n!==null&&mf(n,l[1])?l[0]:(i.memoizedState=[e,n],e)}function gp(e,n){var i=st();n=n===void 0?null:n;var l=i.memoizedState;if(n!==null&&mf(n,l[1]))return l[0];if(l=e(),bo){wn(!0);try{e()}finally{wn(!1)}}return i.memoizedState=[l,n],l}function Tf(e,n,i){return i===void 0||(Qn&1073741824)!==0&&(De&261930)===0?e.memoizedState=n:(e.memoizedState=i,e=yg(),Te.lanes|=e,Dr|=e,i)}function yp(e,n,i,l){return qt(i,n)?i:ui.current!==null?(e=Tf(e,i,l),qt(e,n)||(dt=!0),e):(Qn&42)===0||(Qn&1073741824)!==0&&(De&261930)===0?(dt=!0,e.memoizedState=i):(e=yg(),Te.lanes|=e,Dr|=e,n)}function xp(e,n,i,l,c){var d=H.p;H.p=d!==0&&8>d?d:8;var v=R.T,T={};R.T=T,Rf(e,!1,n,i);try{var L=c(),Q=R.S;if(Q!==null&&Q(T,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var re=N2(L,l);va(e,n,re,Zt(e))}else va(e,n,l,Zt(e))}catch(le){va(e,n,{then:function(){},status:"rejected",reason:le},Zt())}finally{H.p=d,v!==null&&T.types!==null&&(v.types=T.types),R.T=v}}function B2(){}function Cf(e,n,i,l){if(e.tag!==5)throw Error(a(476));var c=vp(e).queue;xp(e,c,n,F,i===null?B2:function(){return bp(e),i(l)})}function vp(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:F},next:null};var i={};return n.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:i},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function bp(e){var n=vp(e);n.next===null&&(n=e.alternate.memoizedState),va(e,n.next.queue,{},Zt())}function Nf(){return Et(Ha)}function _p(){return st().memoizedState}function Ep(){return st().memoizedState}function U2(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var i=Zt();e=Ar(i);var l=Tr(n,e,i);l!==null&&(Vt(l,n,i),ma(l,n,i)),n={cache:nf()},e.payload=n;return}n=n.return}}function H2(e,n,i){var l=Zt();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ms(e)?wp(n,i):(i=Yc(e,n,i,l),i!==null&&(Vt(i,e,l),Ap(i,n,l)))}function Sp(e,n,i){var l=Zt();va(e,n,i,l)}function va(e,n,i,l){var c={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(ms(e))wp(n,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=n.lastRenderedReducer,d!==null))try{var v=n.lastRenderedState,T=d(v,i);if(c.hasEagerState=!0,c.eagerState=T,qt(T,v))return $l(e,n,c,0),Pe===null&&Pl(),!1}catch{}if(i=Yc(e,n,c,l),i!==null)return Vt(i,e,l),Ap(i,n,l),!0}return!1}function Rf(e,n,i,l){if(l={lane:2,revertLane:ld(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ms(e)){if(n)throw Error(a(479))}else n=Yc(e,i,l,2),n!==null&&Vt(n,e,2)}function ms(e){var n=e.alternate;return e===Te||n!==null&&n===Te}function wp(e,n){ci=ls=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function Ap(e,n,i){if((i&4194048)!==0){var l=n.lanes;l&=e.pendingLanes,i|=l,n.lanes=i,Cl(e,i)}}var ba={readContext:Et,use:cs,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useLayoutEffect:rt,useInsertionEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useSyncExternalStore:rt,useId:rt,useHostTransitionStatus:rt,useFormState:rt,useActionState:rt,useOptimistic:rt,useMemoCache:rt,useCacheRefresh:rt};ba.useEffectEvent=rt;var Tp={readContext:Et,use:cs,useCallback:function(e,n){return Dt().memoizedState=[e,n===void 0?null:n],e},useContext:Et,useEffect:up,useImperativeHandle:function(e,n,i){i=i!=null?i.concat([e]):null,ds(4194308,4,hp.bind(null,n,e),i)},useLayoutEffect:function(e,n){return ds(4194308,4,e,n)},useInsertionEffect:function(e,n){ds(4,2,e,n)},useMemo:function(e,n){var i=Dt();n=n===void 0?null:n;var l=e();if(bo){wn(!0);try{e()}finally{wn(!1)}}return i.memoizedState=[l,n],l},useReducer:function(e,n,i){var l=Dt();if(i!==void 0){var c=i(n);if(bo){wn(!0);try{i(n)}finally{wn(!1)}}}else c=n;return l.memoizedState=l.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},l.queue=e,e=e.dispatch=H2.bind(null,Te,e),[l.memoizedState,e]},useRef:function(e){var n=Dt();return e={current:e},n.memoizedState=e},useState:function(e){e=Ef(e);var n=e.queue,i=Sp.bind(null,Te,n);return n.dispatch=i,[e.memoizedState,i]},useDebugValue:Af,useDeferredValue:function(e,n){var i=Dt();return Tf(i,e,n)},useTransition:function(){var e=Ef(!1);return e=xp.bind(null,Te,e.queue,!0,!1),Dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,i){var l=Te,c=Dt();if(Be){if(i===void 0)throw Error(a(407));i=i()}else{if(i=n(),Pe===null)throw Error(a(349));(De&127)!==0||Pm(l,n,i)}c.memoizedState=i;var d={value:i,getSnapshot:n};return c.queue=d,up(Zm.bind(null,l,d,e),[e]),l.flags|=2048,di(9,{destroy:void 0},$m.bind(null,l,d,i,n),null),i},useId:function(){var e=Dt(),n=Pe.identifierPrefix;if(Be){var i=Cn,l=Tn;i=(l&~(1<<32-Mt(l)-1)).toString(32)+i,n="_"+n+"R_"+i,i=ss++,0<i&&(n+="H"+i.toString(32)),n+="_"}else i=R2++,n="_"+n+"r_"+i.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Nf,useFormState:op,useActionState:op,useOptimistic:function(e){var n=Dt();n.memoizedState=n.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=i,n=Rf.bind(null,Te,!0,i),i.dispatch=n,[e,n]},useMemoCache:vf,useCacheRefresh:function(){return Dt().memoizedState=U2.bind(null,Te)},useEffectEvent:function(e){var n=Dt(),i={impl:e};return n.memoizedState=i,function(){if((Ve&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}},Mf={readContext:Et,use:cs,useCallback:pp,useContext:Et,useEffect:wf,useImperativeHandle:mp,useInsertionEffect:fp,useLayoutEffect:dp,useMemo:gp,useReducer:fs,useRef:sp,useState:function(){return fs(Kn)},useDebugValue:Af,useDeferredValue:function(e,n){var i=st();return yp(i,Xe.memoizedState,e,n)},useTransition:function(){var e=fs(Kn)[0],n=st().memoizedState;return[typeof e=="boolean"?e:xa(e),n]},useSyncExternalStore:Im,useId:_p,useHostTransitionStatus:Nf,useFormState:ip,useActionState:ip,useOptimistic:function(e,n){var i=st();return Jm(i,Xe,e,n)},useMemoCache:vf,useCacheRefresh:Ep};Mf.useEffectEvent=cp;var Cp={readContext:Et,use:cs,useCallback:pp,useContext:Et,useEffect:wf,useImperativeHandle:mp,useInsertionEffect:fp,useLayoutEffect:dp,useMemo:gp,useReducer:_f,useRef:sp,useState:function(){return _f(Kn)},useDebugValue:Af,useDeferredValue:function(e,n){var i=st();return Xe===null?Tf(i,e,n):yp(i,Xe.memoizedState,e,n)},useTransition:function(){var e=_f(Kn)[0],n=st().memoizedState;return[typeof e=="boolean"?e:xa(e),n]},useSyncExternalStore:Im,useId:_p,useHostTransitionStatus:Nf,useFormState:lp,useActionState:lp,useOptimistic:function(e,n){var i=st();return Xe!==null?Jm(i,Xe,e,n):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:vf,useCacheRefresh:Ep};Cp.useEffectEvent=cp;function Df(e,n,i,l){n=e.memoizedState,i=i(l,n),i=i==null?n:g({},n,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Of={enqueueSetState:function(e,n,i){e=e._reactInternals;var l=Zt(),c=Ar(l);c.payload=n,i!=null&&(c.callback=i),n=Tr(e,c,l),n!==null&&(Vt(n,e,l),ma(n,e,l))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var l=Zt(),c=Ar(l);c.tag=1,c.payload=n,i!=null&&(c.callback=i),n=Tr(e,c,l),n!==null&&(Vt(n,e,l),ma(n,e,l))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=Zt(),l=Ar(i);l.tag=2,n!=null&&(l.callback=n),n=Tr(e,l,i),n!==null&&(Vt(n,e,i),ma(n,e,i))}};function Np(e,n,i,l,c,d,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,d,v):n.prototype&&n.prototype.isPureReactComponent?!aa(i,l)||!aa(c,d):!0}function Rp(e,n,i,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,l),n.state!==e&&Of.enqueueReplaceState(n,n.state,null)}function _o(e,n){var i=n;if("ref"in n){i={};for(var l in n)l!=="ref"&&(i[l]=n[l])}if(e=e.defaultProps){i===n&&(i=g({},i));for(var c in e)i[c]===void 0&&(i[c]=e[c])}return i}function Mp(e){Il(e)}function Dp(e){console.error(e)}function Op(e){Il(e)}function ps(e,n){try{var i=e.onUncaughtError;i(n.value,{componentStack:n.stack})}catch(l){setTimeout(function(){throw l})}}function zp(e,n,i){try{var l=e.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function zf(e,n,i){return i=Ar(i),i.tag=3,i.payload={element:null},i.callback=function(){ps(e,n)},i}function Bp(e){return e=Ar(e),e.tag=3,e}function Up(e,n,i,l){var c=i.type.getDerivedStateFromError;if(typeof c=="function"){var d=l.value;e.payload=function(){return c(d)},e.callback=function(){zp(n,i,l)}}var v=i.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){zp(n,i,l),typeof c!="function"&&(Or===null?Or=new Set([this]):Or.add(this));var T=l.stack;this.componentDidCatch(l.value,{componentStack:T!==null?T:""})})}function L2(e,n,i,l,c){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(n=i.alternate,n!==null&&oi(n,i,c,!0),i=Yt.current,i!==null){switch(i.tag){case 31:case 13:return an===null?Cs():i.alternate===null&&ot===0&&(ot=3),i.flags&=-257,i.flags|=65536,i.lanes=c,l===ns?i.flags|=16384:(n=i.updateQueue,n===null?i.updateQueue=new Set([l]):n.add(l),od(e,l,c)),!1;case 22:return i.flags|=65536,l===ns?i.flags|=16384:(n=i.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=n):(i=n.retryQueue,i===null?n.retryQueue=new Set([l]):i.add(l)),od(e,l,c)),!1}throw Error(a(435,i.tag))}return od(e,l,c),Cs(),!1}if(Be)return n=Yt.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=c,l!==Kc&&(e=Error(a(422),{cause:l}),ua(tn(e,i)))):(l!==Kc&&(n=Error(a(423),{cause:l}),ua(tn(n,i))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,l=tn(l,i),c=zf(e.stateNode,l,c),uf(e,c),ot!==4&&(ot=2)),!1;var d=Error(a(520),{cause:l});if(d=tn(d,i),Na===null?Na=[d]:Na.push(d),ot!==4&&(ot=2),n===null)return!0;l=tn(l,i),i=n;do{switch(i.tag){case 3:return i.flags|=65536,e=c&-c,i.lanes|=e,e=zf(i.stateNode,l,e),uf(i,e),!1;case 1:if(n=i.type,d=i.stateNode,(i.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Or===null||!Or.has(d))))return i.flags|=65536,c&=-c,i.lanes|=c,c=Bp(c),Up(c,e,i,l),uf(i,c),!1}i=i.return}while(i!==null);return!1}var Bf=Error(a(461)),dt=!1;function St(e,n,i,l){n.child=e===null?Fm(n,null,i,l):vo(n,e.child,i,l)}function Hp(e,n,i,l,c){i=i.render;var d=n.ref;if("ref"in l){var v={};for(var T in l)T!=="ref"&&(v[T]=l[T])}else v=l;return po(n),l=pf(e,n,i,v,d,c),T=gf(),e!==null&&!dt?(yf(e,n,c),Jn(e,n,c)):(Be&&T&&Zc(n),n.flags|=1,St(e,n,l,c),n.child)}function Lp(e,n,i,l,c){if(e===null){var d=i.type;return typeof d=="function"&&!Ic(d)&&d.defaultProps===void 0&&i.compare===null?(n.tag=15,n.type=d,jp(e,n,d,l,c)):(e=Ql(i.type,null,l,n,n.mode,c),e.ref=n.ref,e.return=n,n.child=e)}if(d=e.child,!Gf(e,c)){var v=d.memoizedProps;if(i=i.compare,i=i!==null?i:aa,i(v,l)&&e.ref===n.ref)return Jn(e,n,c)}return n.flags|=1,e=In(d,l),e.ref=n.ref,e.return=n,n.child=e}function jp(e,n,i,l,c){if(e!==null){var d=e.memoizedProps;if(aa(d,l)&&e.ref===n.ref)if(dt=!1,n.pendingProps=l=d,Gf(e,c))(e.flags&131072)!==0&&(dt=!0);else return n.lanes=e.lanes,Jn(e,n,c)}return Uf(e,n,i,l,c)}function Fp(e,n,i,l){var c=l.children,d=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((n.flags&128)!==0){if(d=d!==null?d.baseLanes|i:i,e!==null){for(l=n.child=e.child,c=0;l!==null;)c=c|l.lanes|l.childLanes,l=l.sibling;l=c&~d}else l=0,n.child=null;return kp(e,n,d,i,l)}if((i&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&es(n,d!==null?d.cachePool:null),d!==null?Gm(n,d):ff(),qm(n);else return l=n.lanes=536870912,kp(e,n,d!==null?d.baseLanes|i:i,i,l)}else d!==null?(es(n,d.cachePool),Gm(n,d),Nr(),n.memoizedState=null):(e!==null&&es(n,null),ff(),Nr());return St(e,n,c,i),n.child}function _a(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function kp(e,n,i,l,c){var d=of();return d=d===null?null:{parent:ct._currentValue,pool:d},n.memoizedState={baseLanes:i,cachePool:d},e!==null&&es(n,null),ff(),qm(n),e!==null&&oi(e,n,l,!0),n.childLanes=c,null}function gs(e,n){return n=xs({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Vp(e,n,i){return vo(n,e.child,null,i),e=gs(n,n.pendingProps),e.flags|=2,It(n),n.memoizedState=null,e}function j2(e,n,i){var l=n.pendingProps,c=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Be){if(l.mode==="hidden")return e=gs(n,l),n.lanes=536870912,_a(null,e);if(hf(n),(e=Ze)?(e=Wg(e,on),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:br!==null?{id:Tn,overflow:Cn}:null,retryLane:536870912,hydrationErrors:null},i=wm(e),i.return=n,n.child=i,_t=n,Ze=null)):e=null,e===null)throw Er(n);return n.lanes=536870912,null}return gs(n,l)}var d=e.memoizedState;if(d!==null){var v=d.dehydrated;if(hf(n),c)if(n.flags&256)n.flags&=-257,n=Vp(e,n,i);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(a(558));else if(dt||oi(e,n,i,!1),c=(i&e.childLanes)!==0,dt||c){if(l=Pe,l!==null&&(v=Nl(l,i),v!==0&&v!==d.retryLane))throw d.retryLane=v,co(e,v),Vt(l,e,v),Bf;Cs(),n=Vp(e,n,i)}else e=d.treeContext,Ze=ln(v.nextSibling),_t=n,Be=!0,_r=null,on=!1,e!==null&&Cm(n,e),n=gs(n,l),n.flags|=4096;return n}return e=In(e.child,{mode:l.mode,children:l.children}),e.ref=n.ref,n.child=e,e.return=n,e}function ys(e,n){var i=n.ref;if(i===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(a(284));(e===null||e.ref!==i)&&(n.flags|=4194816)}}function Uf(e,n,i,l,c){return po(n),i=pf(e,n,i,l,void 0,c),l=gf(),e!==null&&!dt?(yf(e,n,c),Jn(e,n,c)):(Be&&l&&Zc(n),n.flags|=1,St(e,n,i,c),n.child)}function Gp(e,n,i,l,c,d){return po(n),n.updateQueue=null,i=Ym(n,l,i,c),Xm(e),l=gf(),e!==null&&!dt?(yf(e,n,d),Jn(e,n,d)):(Be&&l&&Zc(n),n.flags|=1,St(e,n,i,d),n.child)}function qp(e,n,i,l,c){if(po(n),n.stateNode===null){var d=ei,v=i.contextType;typeof v=="object"&&v!==null&&(d=Et(v)),d=new i(l,d),n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Of,n.stateNode=d,d._reactInternals=n,d=n.stateNode,d.props=l,d.state=n.memoizedState,d.refs={},lf(n),v=i.contextType,d.context=typeof v=="object"&&v!==null?Et(v):ei,d.state=n.memoizedState,v=i.getDerivedStateFromProps,typeof v=="function"&&(Df(n,i,v,l),d.state=n.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(v=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),v!==d.state&&Of.enqueueReplaceState(d,d.state,null),ga(n,l,d,c),pa(),d.state=n.memoizedState),typeof d.componentDidMount=="function"&&(n.flags|=4194308),l=!0}else if(e===null){d=n.stateNode;var T=n.memoizedProps,L=_o(i,T);d.props=L;var Q=d.context,re=i.contextType;v=ei,typeof re=="object"&&re!==null&&(v=Et(re));var le=i.getDerivedStateFromProps;re=typeof le=="function"||typeof d.getSnapshotBeforeUpdate=="function",T=n.pendingProps!==T,re||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(T||Q!==v)&&Rp(n,d,l,v),wr=!1;var K=n.memoizedState;d.state=K,ga(n,l,d,c),pa(),Q=n.memoizedState,T||K!==Q||wr?(typeof le=="function"&&(Df(n,i,le,l),Q=n.memoizedState),(L=wr||Np(n,i,L,l,K,Q,v))?(re||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(n.flags|=4194308)):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=Q),d.props=l,d.state=Q,d.context=v,l=L):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{d=n.stateNode,sf(e,n),v=n.memoizedProps,re=_o(i,v),d.props=re,le=n.pendingProps,K=d.context,Q=i.contextType,L=ei,typeof Q=="object"&&Q!==null&&(L=Et(Q)),T=i.getDerivedStateFromProps,(Q=typeof T=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(v!==le||K!==L)&&Rp(n,d,l,L),wr=!1,K=n.memoizedState,d.state=K,ga(n,l,d,c),pa();var J=n.memoizedState;v!==le||K!==J||wr||e!==null&&e.dependencies!==null&&Jl(e.dependencies)?(typeof T=="function"&&(Df(n,i,T,l),J=n.memoizedState),(re=wr||Np(n,i,re,l,K,J,L)||e!==null&&e.dependencies!==null&&Jl(e.dependencies))?(Q||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(l,J,L),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(l,J,L)),typeof d.componentDidUpdate=="function"&&(n.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof d.componentDidUpdate!="function"||v===e.memoizedProps&&K===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&K===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=J),d.props=l,d.state=J,d.context=L,l=re):(typeof d.componentDidUpdate!="function"||v===e.memoizedProps&&K===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&K===e.memoizedState||(n.flags|=1024),l=!1)}return d=l,ys(e,n),l=(n.flags&128)!==0,d||l?(d=n.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:d.render(),n.flags|=1,e!==null&&l?(n.child=vo(n,e.child,null,c),n.child=vo(n,null,i,c)):St(e,n,i,c),n.memoizedState=d.state,e=n.child):e=Jn(e,n,c),e}function Xp(e,n,i,l){return ho(),n.flags|=256,St(e,n,i,l),n.child}var Hf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lf(e){return{baseLanes:e,cachePool:zm()}}function jf(e,n,i){return e=e!==null?e.childLanes&~i:0,n&&(e|=$t),e}function Yp(e,n,i){var l=n.pendingProps,c=!1,d=(n.flags&128)!==0,v;if((v=d)||(v=e!==null&&e.memoizedState===null?!1:(lt.current&2)!==0),v&&(c=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,e===null){if(Be){if(c?Cr(n):Nr(),(e=Ze)?(e=Wg(e,on),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:br!==null?{id:Tn,overflow:Cn}:null,retryLane:536870912,hydrationErrors:null},i=wm(e),i.return=n,n.child=i,_t=n,Ze=null)):e=null,e===null)throw Er(n);return bd(e)?n.lanes=32:n.lanes=536870912,null}var T=l.children;return l=l.fallback,c?(Nr(),c=n.mode,T=xs({mode:"hidden",children:T},c),l=fo(l,c,i,null),T.return=n,l.return=n,T.sibling=l,n.child=T,l=n.child,l.memoizedState=Lf(i),l.childLanes=jf(e,v,i),n.memoizedState=Hf,_a(null,l)):(Cr(n),Ff(n,T))}var L=e.memoizedState;if(L!==null&&(T=L.dehydrated,T!==null)){if(d)n.flags&256?(Cr(n),n.flags&=-257,n=kf(e,n,i)):n.memoizedState!==null?(Nr(),n.child=e.child,n.flags|=128,n=null):(Nr(),T=l.fallback,c=n.mode,l=xs({mode:"visible",children:l.children},c),T=fo(T,c,i,null),T.flags|=2,l.return=n,T.return=n,l.sibling=T,n.child=l,vo(n,e.child,null,i),l=n.child,l.memoizedState=Lf(i),l.childLanes=jf(e,v,i),n.memoizedState=Hf,n=_a(null,l));else if(Cr(n),bd(T)){if(v=T.nextSibling&&T.nextSibling.dataset,v)var Q=v.dgst;v=Q,l=Error(a(419)),l.stack="",l.digest=v,ua({value:l,source:null,stack:null}),n=kf(e,n,i)}else if(dt||oi(e,n,i,!1),v=(i&e.childLanes)!==0,dt||v){if(v=Pe,v!==null&&(l=Nl(v,i),l!==0&&l!==L.retryLane))throw L.retryLane=l,co(e,l),Vt(v,e,l),Bf;vd(T)||Cs(),n=kf(e,n,i)}else vd(T)?(n.flags|=192,n.child=e.child,n=null):(e=L.treeContext,Ze=ln(T.nextSibling),_t=n,Be=!0,_r=null,on=!1,e!==null&&Cm(n,e),n=Ff(n,l.children),n.flags|=4096);return n}return c?(Nr(),T=l.fallback,c=n.mode,L=e.child,Q=L.sibling,l=In(L,{mode:"hidden",children:l.children}),l.subtreeFlags=L.subtreeFlags&65011712,Q!==null?T=In(Q,T):(T=fo(T,c,i,null),T.flags|=2),T.return=n,l.return=n,l.sibling=T,n.child=l,_a(null,l),l=n.child,T=e.child.memoizedState,T===null?T=Lf(i):(c=T.cachePool,c!==null?(L=ct._currentValue,c=c.parent!==L?{parent:L,pool:L}:c):c=zm(),T={baseLanes:T.baseLanes|i,cachePool:c}),l.memoizedState=T,l.childLanes=jf(e,v,i),n.memoizedState=Hf,_a(e.child,l)):(Cr(n),i=e.child,e=i.sibling,i=In(i,{mode:"visible",children:l.children}),i.return=n,i.sibling=null,e!==null&&(v=n.deletions,v===null?(n.deletions=[e],n.flags|=16):v.push(e)),n.child=i,n.memoizedState=null,i)}function Ff(e,n){return n=xs({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function xs(e,n){return e=Xt(22,e,null,n),e.lanes=0,e}function kf(e,n,i){return vo(n,e.child,null,i),e=Ff(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Ip(e,n,i){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),ef(e.return,n,i)}function Vf(e,n,i,l,c,d){var v=e.memoizedState;v===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:c,treeForkCount:d}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=l,v.tail=i,v.tailMode=c,v.treeForkCount=d)}function Pp(e,n,i){var l=n.pendingProps,c=l.revealOrder,d=l.tail;l=l.children;var v=lt.current,T=(v&2)!==0;if(T?(v=v&1|2,n.flags|=128):v&=1,W(lt,v),St(e,n,l,i),l=Be?sa:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ip(e,i,n);else if(e.tag===19)Ip(e,i,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(i=n.child,c=null;i!==null;)e=i.alternate,e!==null&&as(e)===null&&(c=i),i=i.sibling;i=c,i===null?(c=n.child,n.child=null):(c=i.sibling,i.sibling=null),Vf(n,!1,c,i,d,l);break;case"backwards":case"unstable_legacy-backwards":for(i=null,c=n.child,n.child=null;c!==null;){if(e=c.alternate,e!==null&&as(e)===null){n.child=c;break}e=c.sibling,c.sibling=i,i=c,c=e}Vf(n,!0,i,null,d,l);break;case"together":Vf(n,!1,null,null,void 0,l);break;default:n.memoizedState=null}return n.child}function Jn(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),Dr|=n.lanes,(i&n.childLanes)===0)if(e!==null){if(oi(e,n,i,!1),(i&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(a(153));if(n.child!==null){for(e=n.child,i=In(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=In(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function Gf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Jl(e)))}function F2(e,n,i){switch(n.tag){case 3:ue(n,n.stateNode.containerInfo),Sr(n,ct,e.memoizedState.cache),ho();break;case 27:case 5:ge(n);break;case 4:ue(n,n.stateNode.containerInfo);break;case 10:Sr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,hf(n),null;break;case 13:var l=n.memoizedState;if(l!==null)return l.dehydrated!==null?(Cr(n),n.flags|=128,null):(i&n.child.childLanes)!==0?Yp(e,n,i):(Cr(n),e=Jn(e,n,i),e!==null?e.sibling:null);Cr(n);break;case 19:var c=(e.flags&128)!==0;if(l=(i&n.childLanes)!==0,l||(oi(e,n,i,!1),l=(i&n.childLanes)!==0),c){if(l)return Pp(e,n,i);n.flags|=128}if(c=n.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),W(lt,lt.current),l)break;return null;case 22:return n.lanes=0,Fp(e,n,i,n.pendingProps);case 24:Sr(n,ct,e.memoizedState.cache)}return Jn(e,n,i)}function $p(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps)dt=!0;else{if(!Gf(e,i)&&(n.flags&128)===0)return dt=!1,F2(e,n,i);dt=(e.flags&131072)!==0}else dt=!1,Be&&(n.flags&1048576)!==0&&Tm(n,sa,n.index);switch(n.lanes=0,n.tag){case 16:e:{var l=n.pendingProps;if(e=yo(n.elementType),n.type=e,typeof e=="function")Ic(e)?(l=_o(e,l),n.tag=1,n=qp(null,n,e,l,i)):(n.tag=0,n=Uf(null,n,e,l,i));else{if(e!=null){var c=e.$$typeof;if(c===N){n.tag=11,n=Hp(null,n,e,l,i);break e}else if(c===B){n.tag=14,n=Lp(null,n,e,l,i);break e}}throw n=U(e)||e,Error(a(306,n,""))}}return n;case 0:return Uf(e,n,n.type,n.pendingProps,i);case 1:return l=n.type,c=_o(l,n.pendingProps),qp(e,n,l,c,i);case 3:e:{if(ue(n,n.stateNode.containerInfo),e===null)throw Error(a(387));l=n.pendingProps;var d=n.memoizedState;c=d.element,sf(e,n),ga(n,l,null,i);var v=n.memoizedState;if(l=v.cache,Sr(n,ct,l),l!==d.cache&&tf(n,[ct],i,!0),pa(),l=v.element,d.isDehydrated)if(d={element:l,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=d,n.memoizedState=d,n.flags&256){n=Xp(e,n,l,i);break e}else if(l!==c){c=tn(Error(a(424)),n),ua(c),n=Xp(e,n,l,i);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ze=ln(e.firstChild),_t=n,Be=!0,_r=null,on=!0,i=Fm(n,null,l,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(ho(),l===c){n=Jn(e,n,i);break e}St(e,n,l,i)}n=n.child}return n;case 26:return ys(e,n),e===null?(i=iy(n.type,null,n.pendingProps,null))?n.memoizedState=i:Be||(i=n.type,e=n.pendingProps,l=Bs(he.current).createElement(i),l[yt]=n,l[At]=e,wt(l,i,e),ut(l),n.stateNode=l):n.memoizedState=iy(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return ge(n),e===null&&Be&&(l=n.stateNode=ny(n.type,n.pendingProps,he.current),_t=n,on=!0,c=Ze,Hr(n.type)?(_d=c,Ze=ln(l.firstChild)):Ze=c),St(e,n,n.pendingProps.children,i),ys(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Be&&((c=l=Ze)&&(l=pS(l,n.type,n.pendingProps,on),l!==null?(n.stateNode=l,_t=n,Ze=ln(l.firstChild),on=!1,c=!0):c=!1),c||Er(n)),ge(n),c=n.type,d=n.pendingProps,v=e!==null?e.memoizedProps:null,l=d.children,gd(c,d)?l=null:v!==null&&gd(c,v)&&(n.flags|=32),n.memoizedState!==null&&(c=pf(e,n,M2,null,null,i),Ha._currentValue=c),ys(e,n),St(e,n,l,i),n.child;case 6:return e===null&&Be&&((e=i=Ze)&&(i=gS(i,n.pendingProps,on),i!==null?(n.stateNode=i,_t=n,Ze=null,e=!0):e=!1),e||Er(n)),null;case 13:return Yp(e,n,i);case 4:return ue(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=vo(n,null,l,i):St(e,n,l,i),n.child;case 11:return Hp(e,n,n.type,n.pendingProps,i);case 7:return St(e,n,n.pendingProps,i),n.child;case 8:return St(e,n,n.pendingProps.children,i),n.child;case 12:return St(e,n,n.pendingProps.children,i),n.child;case 10:return l=n.pendingProps,Sr(n,n.type,l.value),St(e,n,l.children,i),n.child;case 9:return c=n.type._context,l=n.pendingProps.children,po(n),c=Et(c),l=l(c),n.flags|=1,St(e,n,l,i),n.child;case 14:return Lp(e,n,n.type,n.pendingProps,i);case 15:return jp(e,n,n.type,n.pendingProps,i);case 19:return Pp(e,n,i);case 31:return j2(e,n,i);case 22:return Fp(e,n,i,n.pendingProps);case 24:return po(n),l=Et(ct),e===null?(c=of(),c===null&&(c=Pe,d=nf(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=i),c=d),n.memoizedState={parent:l,cache:c},lf(n),Sr(n,ct,c)):((e.lanes&i)!==0&&(sf(e,n),ga(n,null,null,i),pa()),c=e.memoizedState,d=n.memoizedState,c.parent!==l?(c={parent:l,cache:l},n.memoizedState=c,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=c),Sr(n,ct,l)):(l=d.cache,Sr(n,ct,l),l!==c.cache&&tf(n,[ct],i,!0))),St(e,n,n.pendingProps.children,i),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function Wn(e){e.flags|=4}function qf(e,n,i,l,c){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(_g())e.flags|=8192;else throw xo=ns,af}else e.flags&=-16777217}function Zp(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!cy(n))if(_g())e.flags|=8192;else throw xo=ns,af}function vs(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Al():536870912,e.lanes|=n,gi|=n)}function Ea(e,n){if(!Be)switch(e.tailMode){case"hidden":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Qe(e){var n=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(n)for(var c=e.child;c!==null;)i|=c.lanes|c.childLanes,l|=c.subtreeFlags&65011712,l|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)i|=c.lanes|c.childLanes,l|=c.subtreeFlags,l|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=l,e.childLanes=i,n}function k2(e,n,i){var l=n.pendingProps;switch(Qc(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qe(n),null;case 1:return Qe(n),null;case 3:return i=n.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Zn(ct),de(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ri(n)?Wn(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Jc())),Qe(n),null;case 26:var c=n.type,d=n.memoizedState;return e===null?(Wn(n),d!==null?(Qe(n),Zp(n,d)):(Qe(n),qf(n,c,null,l,i))):d?d!==e.memoizedState?(Wn(n),Qe(n),Zp(n,d)):(Qe(n),n.flags&=-16777217):(e=e.memoizedProps,e!==l&&Wn(n),Qe(n),qf(n,c,e,l,i)),null;case 27:if(Se(n),i=he.current,c=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&Wn(n);else{if(!l){if(n.stateNode===null)throw Error(a(166));return Qe(n),null}e=ne.current,ri(n)?Nm(n):(e=ny(c,l,i),n.stateNode=e,Wn(n))}return Qe(n),null;case 5:if(Se(n),c=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&Wn(n);else{if(!l){if(n.stateNode===null)throw Error(a(166));return Qe(n),null}if(d=ne.current,ri(n))Nm(n);else{var v=Bs(he.current);switch(d){case 1:d=v.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=v.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=v.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=v.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=v.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof l.is=="string"?v.createElement("select",{is:l.is}):v.createElement("select"),l.multiple?d.multiple=!0:l.size&&(d.size=l.size);break;default:d=typeof l.is=="string"?v.createElement(c,{is:l.is}):v.createElement(c)}}d[yt]=n,d[At]=l;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)d.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===n)break e;for(;v.sibling===null;){if(v.return===null||v.return===n)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}n.stateNode=d;e:switch(wt(d,c,l),c){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Wn(n)}}return Qe(n),qf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,i),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==l&&Wn(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(a(166));if(e=he.current,ri(n)){if(e=n.stateNode,i=n.memoizedProps,l=null,c=_t,c!==null)switch(c.tag){case 27:case 5:l=c.memoizedProps}e[yt]=n,e=!!(e.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||Yg(e.nodeValue,i)),e||Er(n,!0)}else e=Bs(e).createTextNode(l),e[yt]=n,n.stateNode=e}return Qe(n),null;case 31:if(i=n.memoizedState,e===null||e.memoizedState!==null){if(l=ri(n),i!==null){if(e===null){if(!l)throw Error(a(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[yt]=n}else ho(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Qe(n),e=!1}else i=Jc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return n.flags&256?(It(n),n):(It(n),null);if((n.flags&128)!==0)throw Error(a(558))}return Qe(n),null;case 13:if(l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=ri(n),l!==null&&l.dehydrated!==null){if(e===null){if(!c)throw Error(a(318));if(c=n.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));c[yt]=n}else ho(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Qe(n),c=!1}else c=Jc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return n.flags&256?(It(n),n):(It(n),null)}return It(n),(n.flags&128)!==0?(n.lanes=i,n):(i=l!==null,e=e!==null&&e.memoizedState!==null,i&&(l=n.child,c=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(c=l.alternate.memoizedState.cachePool.pool),d=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),d!==c&&(l.flags|=2048)),i!==e&&i&&(n.child.flags|=8192),vs(n,n.updateQueue),Qe(n),null);case 4:return de(),e===null&&fd(n.stateNode.containerInfo),Qe(n),null;case 10:return Zn(n.type),Qe(n),null;case 19:if(k(lt),l=n.memoizedState,l===null)return Qe(n),null;if(c=(n.flags&128)!==0,d=l.rendering,d===null)if(c)Ea(l,!1);else{if(ot!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(d=as(e),d!==null){for(n.flags|=128,Ea(l,!1),e=d.updateQueue,n.updateQueue=e,vs(n,e),n.subtreeFlags=0,e=i,i=n.child;i!==null;)Sm(i,e),i=i.sibling;return W(lt,lt.current&1|2),Be&&Pn(n,l.treeForkCount),n.child}e=e.sibling}l.tail!==null&&at()>ws&&(n.flags|=128,c=!0,Ea(l,!1),n.lanes=4194304)}else{if(!c)if(e=as(d),e!==null){if(n.flags|=128,c=!0,e=e.updateQueue,n.updateQueue=e,vs(n,e),Ea(l,!0),l.tail===null&&l.tailMode==="hidden"&&!d.alternate&&!Be)return Qe(n),null}else 2*at()-l.renderingStartTime>ws&&i!==536870912&&(n.flags|=128,c=!0,Ea(l,!1),n.lanes=4194304);l.isBackwards?(d.sibling=n.child,n.child=d):(e=l.last,e!==null?e.sibling=d:n.child=d,l.last=d)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=at(),e.sibling=null,i=lt.current,W(lt,c?i&1|2:i&1),Be&&Pn(n,l.treeForkCount),e):(Qe(n),null);case 22:case 23:return It(n),df(),l=n.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(i&536870912)!==0&&(n.flags&128)===0&&(Qe(n),n.subtreeFlags&6&&(n.flags|=8192)):Qe(n),i=n.updateQueue,i!==null&&vs(n,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==i&&(n.flags|=2048),e!==null&&k(go),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),Zn(ct),Qe(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function V2(e,n){switch(Qc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Zn(ct),de(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Se(n),null;case 31:if(n.memoizedState!==null){if(It(n),n.alternate===null)throw Error(a(340));ho()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(It(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(a(340));ho()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return k(lt),null;case 4:return de(),null;case 10:return Zn(n.type),null;case 22:case 23:return It(n),df(),e!==null&&k(go),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Zn(ct),null;case 25:return null;default:return null}}function Qp(e,n){switch(Qc(n),n.tag){case 3:Zn(ct),de();break;case 26:case 27:case 5:Se(n);break;case 4:de();break;case 31:n.memoizedState!==null&&It(n);break;case 13:It(n);break;case 19:k(lt);break;case 10:Zn(n.type);break;case 22:case 23:It(n),df(),e!==null&&k(go);break;case 24:Zn(ct)}}function Sa(e,n){try{var i=n.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var c=l.next;i=c;do{if((i.tag&e)===e){l=void 0;var d=i.create,v=i.inst;l=d(),v.destroy=l}i=i.next}while(i!==c)}}catch(T){qe(n,n.return,T)}}function Rr(e,n,i){try{var l=n.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var d=c.next;l=d;do{if((l.tag&e)===e){var v=l.inst,T=v.destroy;if(T!==void 0){v.destroy=void 0,c=n;var L=i,Q=T;try{Q()}catch(re){qe(c,L,re)}}}l=l.next}while(l!==d)}}catch(re){qe(n,n.return,re)}}function Kp(e){var n=e.updateQueue;if(n!==null){var i=e.stateNode;try{Vm(n,i)}catch(l){qe(e,e.return,l)}}}function Jp(e,n,i){i.props=_o(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(l){qe(e,n,l)}}function wa(e,n){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof i=="function"?e.refCleanup=i(l):i.current=l}}catch(c){qe(e,n,c)}}function Nn(e,n){var i=e.ref,l=e.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(c){qe(e,n,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(c){qe(e,n,c)}else i.current=null}function Wp(e){var n=e.type,i=e.memoizedProps,l=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(c){qe(e,e.return,c)}}function Xf(e,n,i){try{var l=e.stateNode;uS(l,e.type,i,n),l[At]=n}catch(c){qe(e,e.return,c)}}function eg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Hr(e.type)||e.tag===4}function Yf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||eg(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.tag===27&&Hr(e.type)||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 If(e,n,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,n):(n=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,n.appendChild(e),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=Xn));else if(l!==4&&(l===27&&Hr(e.type)&&(i=e.stateNode,n=null),e=e.child,e!==null))for(If(e,n,i),e=e.sibling;e!==null;)If(e,n,i),e=e.sibling}function bs(e,n,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(l!==4&&(l===27&&Hr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(bs(e,n,i),e=e.sibling;e!==null;)bs(e,n,i),e=e.sibling}function tg(e){var n=e.stateNode,i=e.memoizedProps;try{for(var l=e.type,c=n.attributes;c.length;)n.removeAttributeNode(c[0]);wt(n,l,i),n[yt]=e,n[At]=i}catch(d){qe(e,e.return,d)}}var er=!1,ht=!1,Pf=!1,ng=typeof WeakSet=="function"?WeakSet:Set,bt=null;function G2(e,n){if(e=e.containerInfo,md=Vs,e=mm(e),Fc(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var c=l.anchorOffset,d=l.focusNode;l=l.focusOffset;try{i.nodeType,d.nodeType}catch{i=null;break e}var v=0,T=-1,L=-1,Q=0,re=0,le=e,K=null;t:for(;;){for(var J;le!==i||c!==0&&le.nodeType!==3||(T=v+c),le!==d||l!==0&&le.nodeType!==3||(L=v+l),le.nodeType===3&&(v+=le.nodeValue.length),(J=le.firstChild)!==null;)K=le,le=J;for(;;){if(le===e)break t;if(K===i&&++Q===c&&(T=v),K===d&&++re===l&&(L=v),(J=le.nextSibling)!==null)break;le=K,K=le.parentNode}le=J}i=T===-1||L===-1?null:{start:T,end:L}}else i=null}i=i||{start:0,end:0}}else i=null;for(pd={focusedElem:e,selectionRange:i},Vs=!1,bt=n;bt!==null;)if(n=bt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,bt=e;else for(;bt!==null;){switch(n=bt,d=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)c=e[i],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,i=n,c=d.memoizedProps,d=d.memoizedState,l=i.stateNode;try{var pe=_o(i.type,c);e=l.getSnapshotBeforeUpdate(pe,d),l.__reactInternalSnapshotBeforeUpdate=e}catch(_e){qe(i,i.return,_e)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,i=e.nodeType,i===9)xd(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":xd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=n.sibling,e!==null){e.return=n.return,bt=e;break}bt=n.return}}function rg(e,n,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:nr(e,i),l&4&&Sa(5,i);break;case 1:if(nr(e,i),l&4)if(e=i.stateNode,n===null)try{e.componentDidMount()}catch(v){qe(i,i.return,v)}else{var c=_o(i.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(c,n,e.__reactInternalSnapshotBeforeUpdate)}catch(v){qe(i,i.return,v)}}l&64&&Kp(i),l&512&&wa(i,i.return);break;case 3:if(nr(e,i),l&64&&(e=i.updateQueue,e!==null)){if(n=null,i.child!==null)switch(i.child.tag){case 27:case 5:n=i.child.stateNode;break;case 1:n=i.child.stateNode}try{Vm(e,n)}catch(v){qe(i,i.return,v)}}break;case 27:n===null&&l&4&&tg(i);case 26:case 5:nr(e,i),n===null&&l&4&&Wp(i),l&512&&wa(i,i.return);break;case 12:nr(e,i);break;case 31:nr(e,i),l&4&&ag(e,i);break;case 13:nr(e,i),l&4&&lg(e,i),l&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=K2.bind(null,i),yS(e,i))));break;case 22:if(l=i.memoizedState!==null||er,!l){n=n!==null&&n.memoizedState!==null||ht,c=er;var d=ht;er=l,(ht=n)&&!d?rr(e,i,(i.subtreeFlags&8772)!==0):nr(e,i),er=c,ht=d}break;case 30:break;default:nr(e,i)}}function og(e){var n=e.alternate;n!==null&&(e.alternate=null,og(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Qi(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Je=null,Lt=!1;function tr(e,n,i){for(i=i.child;i!==null;)ig(e,n,i),i=i.sibling}function ig(e,n,i){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(to,i)}catch{}switch(i.tag){case 26:ht||Nn(i,n),tr(e,n,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ht||Nn(i,n);var l=Je,c=Lt;Hr(i.type)&&(Je=i.stateNode,Lt=!1),tr(e,n,i),za(i.stateNode),Je=l,Lt=c;break;case 5:ht||Nn(i,n);case 6:if(l=Je,c=Lt,Je=null,tr(e,n,i),Je=l,Lt=c,Je!==null)if(Lt)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(i.stateNode)}catch(d){qe(i,n,d)}else try{Je.removeChild(i.stateNode)}catch(d){qe(i,n,d)}break;case 18:Je!==null&&(Lt?(e=Je,Kg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),wi(e)):Kg(Je,i.stateNode));break;case 4:l=Je,c=Lt,Je=i.stateNode.containerInfo,Lt=!0,tr(e,n,i),Je=l,Lt=c;break;case 0:case 11:case 14:case 15:Rr(2,i,n),ht||Rr(4,i,n),tr(e,n,i);break;case 1:ht||(Nn(i,n),l=i.stateNode,typeof l.componentWillUnmount=="function"&&Jp(i,n,l)),tr(e,n,i);break;case 21:tr(e,n,i);break;case 22:ht=(l=ht)||i.memoizedState!==null,tr(e,n,i),ht=l;break;default:tr(e,n,i)}}function ag(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{wi(e)}catch(i){qe(n,n.return,i)}}}function lg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{wi(e)}catch(i){qe(n,n.return,i)}}function q2(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new ng),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new ng),n;default:throw Error(a(435,e.tag))}}function _s(e,n){var i=q2(e);n.forEach(function(l){if(!i.has(l)){i.add(l);var c=J2.bind(null,e,l);l.then(c,c)}})}function jt(e,n){var i=n.deletions;if(i!==null)for(var l=0;l<i.length;l++){var c=i[l],d=e,v=n,T=v;e:for(;T!==null;){switch(T.tag){case 27:if(Hr(T.type)){Je=T.stateNode,Lt=!1;break e}break;case 5:Je=T.stateNode,Lt=!1;break e;case 3:case 4:Je=T.stateNode.containerInfo,Lt=!0;break e}T=T.return}if(Je===null)throw Error(a(160));ig(d,v,c),Je=null,Lt=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)sg(n,e),n=n.sibling}var hn=null;function sg(e,n){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:jt(n,e),Ft(e),l&4&&(Rr(3,e,e.return),Sa(3,e),Rr(5,e,e.return));break;case 1:jt(n,e),Ft(e),l&512&&(ht||i===null||Nn(i,i.return)),l&64&&er&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var c=hn;if(jt(n,e),Ft(e),l&512&&(ht||i===null||Nn(i,i.return)),l&4){var d=i!==null?i.memoizedState:null;if(l=e.memoizedState,i===null)if(l===null)if(e.stateNode===null){e:{l=e.type,i=e.memoizedProps,c=c.ownerDocument||c;t:switch(l){case"title":d=c.getElementsByTagName("title")[0],(!d||d[oo]||d[yt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(l),c.head.insertBefore(d,c.querySelector("head > title"))),wt(d,l,i),d[yt]=e,ut(d),l=d;break e;case"link":var v=sy("link","href",c).get(l+(i.href||""));if(v){for(var T=0;T<v.length;T++)if(d=v[T],d.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&d.getAttribute("rel")===(i.rel==null?null:i.rel)&&d.getAttribute("title")===(i.title==null?null:i.title)&&d.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){v.splice(T,1);break t}}d=c.createElement(l),wt(d,l,i),c.head.appendChild(d);break;case"meta":if(v=sy("meta","content",c).get(l+(i.content||""))){for(T=0;T<v.length;T++)if(d=v[T],d.getAttribute("content")===(i.content==null?null:""+i.content)&&d.getAttribute("name")===(i.name==null?null:i.name)&&d.getAttribute("property")===(i.property==null?null:i.property)&&d.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&d.getAttribute("charset")===(i.charSet==null?null:i.charSet)){v.splice(T,1);break t}}d=c.createElement(l),wt(d,l,i),c.head.appendChild(d);break;default:throw Error(a(468,l))}d[yt]=e,ut(d),l=d}e.stateNode=l}else uy(c,e.type,e.stateNode);else e.stateNode=ly(c,l,e.memoizedProps);else d!==l?(d===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):d.count--,l===null?uy(c,e.type,e.stateNode):ly(c,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Xf(e,e.memoizedProps,i.memoizedProps)}break;case 27:jt(n,e),Ft(e),l&512&&(ht||i===null||Nn(i,i.return)),i!==null&&l&4&&Xf(e,e.memoizedProps,i.memoizedProps);break;case 5:if(jt(n,e),Ft(e),l&512&&(ht||i===null||Nn(i,i.return)),e.flags&32){c=e.stateNode;try{Po(c,"")}catch(pe){qe(e,e.return,pe)}}l&4&&e.stateNode!=null&&(c=e.memoizedProps,Xf(e,c,i!==null?i.memoizedProps:c)),l&1024&&(Pf=!0);break;case 6:if(jt(n,e),Ft(e),l&4){if(e.stateNode===null)throw Error(a(162));l=e.memoizedProps,i=e.stateNode;try{i.nodeValue=l}catch(pe){qe(e,e.return,pe)}}break;case 3:if(Ls=null,c=hn,hn=Us(n.containerInfo),jt(n,e),hn=c,Ft(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{wi(n.containerInfo)}catch(pe){qe(e,e.return,pe)}Pf&&(Pf=!1,ug(e));break;case 4:l=hn,hn=Us(e.stateNode.containerInfo),jt(n,e),Ft(e),hn=l;break;case 12:jt(n,e),Ft(e);break;case 31:jt(n,e),Ft(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,_s(e,l)));break;case 13:jt(n,e),Ft(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Ss=at()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,_s(e,l)));break;case 22:c=e.memoizedState!==null;var L=i!==null&&i.memoizedState!==null,Q=er,re=ht;if(er=Q||c,ht=re||L,jt(n,e),ht=re,er=Q,Ft(e),l&8192)e:for(n=e.stateNode,n._visibility=c?n._visibility&-2:n._visibility|1,c&&(i===null||L||er||ht||Eo(e)),i=null,n=e;;){if(n.tag===5||n.tag===26){if(i===null){L=i=n;try{if(d=L.stateNode,c)v=d.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{T=L.stateNode;var le=L.memoizedProps.style,K=le!=null&&le.hasOwnProperty("display")?le.display:null;T.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(pe){qe(L,L.return,pe)}}}else if(n.tag===6){if(i===null){L=n;try{L.stateNode.nodeValue=c?"":L.memoizedProps}catch(pe){qe(L,L.return,pe)}}}else if(n.tag===18){if(i===null){L=n;try{var J=L.stateNode;c?Jg(J,!0):Jg(L.stateNode,!1)}catch(pe){qe(L,L.return,pe)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;i===n&&(i=null),n=n.return}i===n&&(i=null),n.sibling.return=n.return,n=n.sibling}l&4&&(l=e.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,_s(e,i))));break;case 19:jt(n,e),Ft(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,_s(e,l)));break;case 30:break;case 21:break;default:jt(n,e),Ft(e)}}function Ft(e){var n=e.flags;if(n&2){try{for(var i,l=e.return;l!==null;){if(eg(l)){i=l;break}l=l.return}if(i==null)throw Error(a(160));switch(i.tag){case 27:var c=i.stateNode,d=Yf(e);bs(e,d,c);break;case 5:var v=i.stateNode;i.flags&32&&(Po(v,""),i.flags&=-33);var T=Yf(e);bs(e,T,v);break;case 3:case 4:var L=i.stateNode.containerInfo,Q=Yf(e);If(e,Q,L);break;default:throw Error(a(161))}}catch(re){qe(e,e.return,re)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function ug(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;ug(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function nr(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)rg(e,n.alternate,n),n=n.sibling}function Eo(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Rr(4,n,n.return),Eo(n);break;case 1:Nn(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&Jp(n,n.return,i),Eo(n);break;case 27:za(n.stateNode);case 26:case 5:Nn(n,n.return),Eo(n);break;case 22:n.memoizedState===null&&Eo(n);break;case 30:Eo(n);break;default:Eo(n)}e=e.sibling}}function rr(e,n,i){for(i=i&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var l=n.alternate,c=e,d=n,v=d.flags;switch(d.tag){case 0:case 11:case 15:rr(c,d,i),Sa(4,d);break;case 1:if(rr(c,d,i),l=d,c=l.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(Q){qe(l,l.return,Q)}if(l=d,c=l.updateQueue,c!==null){var T=l.stateNode;try{var L=c.shared.hiddenCallbacks;if(L!==null)for(c.shared.hiddenCallbacks=null,c=0;c<L.length;c++)km(L[c],T)}catch(Q){qe(l,l.return,Q)}}i&&v&64&&Kp(d),wa(d,d.return);break;case 27:tg(d);case 26:case 5:rr(c,d,i),i&&l===null&&v&4&&Wp(d),wa(d,d.return);break;case 12:rr(c,d,i);break;case 31:rr(c,d,i),i&&v&4&&ag(c,d);break;case 13:rr(c,d,i),i&&v&4&&lg(c,d);break;case 22:d.memoizedState===null&&rr(c,d,i),wa(d,d.return);break;case 30:break;default:rr(c,d,i)}n=n.sibling}}function $f(e,n){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&ca(i))}function Zf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ca(e))}function mn(e,n,i,l){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)cg(e,n,i,l),n=n.sibling}function cg(e,n,i,l){var c=n.flags;switch(n.tag){case 0:case 11:case 15:mn(e,n,i,l),c&2048&&Sa(9,n);break;case 1:mn(e,n,i,l);break;case 3:mn(e,n,i,l),c&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ca(e)));break;case 12:if(c&2048){mn(e,n,i,l),e=n.stateNode;try{var d=n.memoizedProps,v=d.id,T=d.onPostCommit;typeof T=="function"&&T(v,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(L){qe(n,n.return,L)}}else mn(e,n,i,l);break;case 31:mn(e,n,i,l);break;case 13:mn(e,n,i,l);break;case 23:break;case 22:d=n.stateNode,v=n.alternate,n.memoizedState!==null?d._visibility&2?mn(e,n,i,l):Aa(e,n):d._visibility&2?mn(e,n,i,l):(d._visibility|=2,hi(e,n,i,l,(n.subtreeFlags&10256)!==0||!1)),c&2048&&$f(v,n);break;case 24:mn(e,n,i,l),c&2048&&Zf(n.alternate,n);break;default:mn(e,n,i,l)}}function hi(e,n,i,l,c){for(c=c&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var d=e,v=n,T=i,L=l,Q=v.flags;switch(v.tag){case 0:case 11:case 15:hi(d,v,T,L,c),Sa(8,v);break;case 23:break;case 22:var re=v.stateNode;v.memoizedState!==null?re._visibility&2?hi(d,v,T,L,c):Aa(d,v):(re._visibility|=2,hi(d,v,T,L,c)),c&&Q&2048&&$f(v.alternate,v);break;case 24:hi(d,v,T,L,c),c&&Q&2048&&Zf(v.alternate,v);break;default:hi(d,v,T,L,c)}n=n.sibling}}function Aa(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var i=e,l=n,c=l.flags;switch(l.tag){case 22:Aa(i,l),c&2048&&$f(l.alternate,l);break;case 24:Aa(i,l),c&2048&&Zf(l.alternate,l);break;default:Aa(i,l)}n=n.sibling}}var Ta=8192;function mi(e,n,i){if(e.subtreeFlags&Ta)for(e=e.child;e!==null;)fg(e,n,i),e=e.sibling}function fg(e,n,i){switch(e.tag){case 26:mi(e,n,i),e.flags&Ta&&e.memoizedState!==null&&RS(i,hn,e.memoizedState,e.memoizedProps);break;case 5:mi(e,n,i);break;case 3:case 4:var l=hn;hn=Us(e.stateNode.containerInfo),mi(e,n,i),hn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Ta,Ta=16777216,mi(e,n,i),Ta=l):mi(e,n,i));break;default:mi(e,n,i)}}function dg(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Ca(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var l=n[i];bt=l,mg(l,e)}dg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)hg(e),e=e.sibling}function hg(e){switch(e.tag){case 0:case 11:case 15:Ca(e),e.flags&2048&&Rr(9,e,e.return);break;case 3:Ca(e);break;case 12:Ca(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Es(e)):Ca(e);break;default:Ca(e)}}function Es(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var l=n[i];bt=l,mg(l,e)}dg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Rr(8,n,n.return),Es(n);break;case 22:i=n.stateNode,i._visibility&2&&(i._visibility&=-3,Es(n));break;default:Es(n)}e=e.sibling}}function mg(e,n){for(;bt!==null;){var i=bt;switch(i.tag){case 0:case 11:case 15:Rr(8,i,n);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ca(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,bt=l;else e:for(i=e;bt!==null;){l=bt;var c=l.sibling,d=l.return;if(og(l),l===i){bt=null;break e}if(c!==null){c.return=d,bt=c;break e}bt=d}}}var X2={getCacheForType:function(e){var n=Et(ct),i=n.data.get(e);return i===void 0&&(i=e(),n.data.set(e,i)),i},cacheSignal:function(){return Et(ct).controller.signal}},Y2=typeof WeakMap=="function"?WeakMap:Map,Ve=0,Pe=null,Re=null,De=0,Ge=0,Pt=null,Mr=!1,pi=!1,Qf=!1,or=0,ot=0,Dr=0,So=0,Kf=0,$t=0,gi=0,Na=null,kt=null,Jf=!1,Ss=0,pg=0,ws=1/0,As=null,Or=null,xt=0,zr=null,yi=null,ir=0,Wf=0,ed=null,gg=null,Ra=0,td=null;function Zt(){return(Ve&2)!==0&&De!==0?De&-De:R.T!==null?ld():Rl()}function yg(){if($t===0)if((De&536870912)===0||Be){var e=ko;ko<<=1,(ko&3932160)===0&&(ko=262144),$t=e}else $t=536870912;return e=Yt.current,e!==null&&(e.flags|=32),$t}function Vt(e,n,i){(e===Pe&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)&&(xi(e,0),Br(e,De,$t,!1)),ro(e,i),((Ve&2)===0||e!==Pe)&&(e===Pe&&((Ve&2)===0&&(So|=i),ot===4&&Br(e,De,$t,!1)),Rn(e))}function xg(e,n,i){if((Ve&6)!==0)throw Error(a(327));var l=!i&&(n&127)===0&&(n&e.expiredLanes)===0||no(e,n),c=l?$2(e,n):rd(e,n,!0),d=l;do{if(c===0){pi&&!l&&Br(e,n,0,!1);break}else{if(i=e.current.alternate,d&&!I2(i)){c=rd(e,n,!1),d=!1;continue}if(c===2){if(d=n,e.errorRecoveryDisabledLanes&d)var v=0;else v=e.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var T=e;c=Na;var L=T.current.memoizedState.isDehydrated;if(L&&(xi(T,v).flags|=256),v=rd(T,v,!1),v!==2){if(Qf&&!L){T.errorRecoveryDisabledLanes|=d,So|=d,c=4;break e}d=kt,kt=c,d!==null&&(kt===null?kt=d:kt.push.apply(kt,d))}c=v}if(d=!1,c!==2)continue}}if(c===1){xi(e,0),Br(e,n,0,!0);break}e:{switch(l=e,d=c,d){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n)break;case 6:Br(l,n,$t,!Mr);break e;case 2:kt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(c=Ss+300-at(),10<c)){if(Br(l,n,$t,!Mr),Go(l,0,!0)!==0)break e;ir=n,l.timeoutHandle=Zg(vg.bind(null,l,i,kt,As,Jf,n,$t,So,gi,Mr,d,"Throttled",-0,0),c);break e}vg(l,i,kt,As,Jf,n,$t,So,gi,Mr,d,null,-0,0)}}break}while(!0);Rn(e)}function vg(e,n,i,l,c,d,v,T,L,Q,re,le,K,J){if(e.timeoutHandle=-1,le=n.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xn},fg(n,d,le);var pe=(d&62914560)===d?Ss-at():(d&4194048)===d?pg-at():0;if(pe=MS(le,pe),pe!==null){ir=d,e.cancelPendingCommit=pe(Cg.bind(null,e,n,d,i,l,c,v,T,L,re,le,null,K,J)),Br(e,d,v,!Q);return}}Cg(e,n,d,i,l,c,v,T,L)}function I2(e){for(var n=e;;){var i=n.tag;if((i===0||i===11||i===15)&&n.flags&16384&&(i=n.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var c=i[l],d=c.getSnapshot;c=c.value;try{if(!qt(d(),c))return!1}catch{return!1}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Br(e,n,i,l){n&=~Kf,n&=~So,e.suspendedLanes|=n,e.pingedLanes&=~n,l&&(e.warmLanes|=n),l=e.expirationTimes;for(var c=n;0<c;){var d=31-Mt(c),v=1<<d;l[d]=-1,c&=~v}i!==0&&Tl(e,i,n)}function Ts(){return(Ve&6)===0?(Ma(0),!1):!0}function nd(){if(Re!==null){if(Ge===0)var e=Re.return;else e=Re,$n=mo=null,xf(e),si=null,da=0,e=Re;for(;e!==null;)Qp(e.alternate,e),e=e.return;Re=null}}function xi(e,n){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,dS(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),ir=0,nd(),Pe=e,Re=i=In(e.current,null),De=n,Ge=0,Pt=null,Mr=!1,pi=no(e,n),Qf=!1,gi=$t=Kf=So=Dr=ot=0,kt=Na=null,Jf=!1,(n&8)!==0&&(n|=n&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=n;0<l;){var c=31-Mt(l),d=1<<c;n|=e[c],l&=~d}return or=n,Pl(),i}function bg(e,n){Te=null,R.H=ba,n===li||n===ts?(n=Hm(),Ge=3):n===af?(n=Hm(),Ge=4):Ge=n===Bf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Pt=n,Re===null&&(ot=1,ps(e,tn(n,e.current)))}function _g(){var e=Yt.current;return e===null?!0:(De&4194048)===De?an===null:(De&62914560)===De||(De&536870912)!==0?e===an:!1}function Eg(){var e=R.H;return R.H=ba,e===null?ba:e}function Sg(){var e=R.A;return R.A=X2,e}function Cs(){ot=4,Mr||(De&4194048)!==De&&Yt.current!==null||(pi=!0),(Dr&134217727)===0&&(So&134217727)===0||Pe===null||Br(Pe,De,$t,!1)}function rd(e,n,i){var l=Ve;Ve|=2;var c=Eg(),d=Sg();(Pe!==e||De!==n)&&(As=null,xi(e,n)),n=!1;var v=ot;e:do try{if(Ge!==0&&Re!==null){var T=Re,L=Pt;switch(Ge){case 8:nd(),v=6;break e;case 3:case 2:case 9:case 6:Yt.current===null&&(n=!0);var Q=Ge;if(Ge=0,Pt=null,vi(e,T,L,Q),i&&pi){v=0;break e}break;default:Q=Ge,Ge=0,Pt=null,vi(e,T,L,Q)}}P2(),v=ot;break}catch(re){bg(e,re)}while(!0);return n&&e.shellSuspendCounter++,$n=mo=null,Ve=l,R.H=c,R.A=d,Re===null&&(Pe=null,De=0,Pl()),v}function P2(){for(;Re!==null;)wg(Re)}function $2(e,n){var i=Ve;Ve|=2;var l=Eg(),c=Sg();Pe!==e||De!==n?(As=null,ws=at()+500,xi(e,n)):pi=no(e,n);e:do try{if(Ge!==0&&Re!==null){n=Re;var d=Pt;t:switch(Ge){case 1:Ge=0,Pt=null,vi(e,n,d,1);break;case 2:case 9:if(Bm(d)){Ge=0,Pt=null,Ag(n);break}n=function(){Ge!==2&&Ge!==9||Pe!==e||(Ge=7),Rn(e)},d.then(n,n);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:Bm(d)?(Ge=0,Pt=null,Ag(n)):(Ge=0,Pt=null,vi(e,n,d,7));break;case 5:var v=null;switch(Re.tag){case 26:v=Re.memoizedState;case 5:case 27:var T=Re;if(v?cy(v):T.stateNode.complete){Ge=0,Pt=null;var L=T.sibling;if(L!==null)Re=L;else{var Q=T.return;Q!==null?(Re=Q,Ns(Q)):Re=null}break t}}Ge=0,Pt=null,vi(e,n,d,5);break;case 6:Ge=0,Pt=null,vi(e,n,d,6);break;case 8:nd(),ot=6;break e;default:throw Error(a(462))}}Z2();break}catch(re){bg(e,re)}while(!0);return $n=mo=null,R.H=l,R.A=c,Ve=i,Re!==null?0:(Pe=null,De=0,Pl(),ot)}function Z2(){for(;Re!==null&&!$e();)wg(Re)}function wg(e){var n=$p(e.alternate,e,or);e.memoizedProps=e.pendingProps,n===null?Ns(e):Re=n}function Ag(e){var n=e,i=n.alternate;switch(n.tag){case 15:case 0:n=Gp(i,n,n.pendingProps,n.type,void 0,De);break;case 11:n=Gp(i,n,n.pendingProps,n.type.render,n.ref,De);break;case 5:xf(n);default:Qp(i,n),n=Re=Sm(n,or),n=$p(i,n,or)}e.memoizedProps=e.pendingProps,n===null?Ns(e):Re=n}function vi(e,n,i,l){$n=mo=null,xf(n),si=null,da=0;var c=n.return;try{if(L2(e,c,n,i,De)){ot=1,ps(e,tn(i,e.current)),Re=null;return}}catch(d){if(c!==null)throw Re=c,d;ot=1,ps(e,tn(i,e.current)),Re=null;return}n.flags&32768?(Be||l===1?e=!0:pi||(De&536870912)!==0?e=!1:(Mr=e=!0,(l===2||l===9||l===3||l===6)&&(l=Yt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Tg(n,e)):Ns(n)}function Ns(e){var n=e;do{if((n.flags&32768)!==0){Tg(n,Mr);return}e=n.return;var i=k2(n.alternate,n,or);if(i!==null){Re=i;return}if(n=n.sibling,n!==null){Re=n;return}Re=n=e}while(n!==null);ot===0&&(ot=5)}function Tg(e,n){do{var i=V2(e.alternate,e);if(i!==null){i.flags&=32767,Re=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!n&&(e=e.sibling,e!==null)){Re=e;return}Re=e=i}while(e!==null);ot=6,Re=null}function Cg(e,n,i,l,c,d,v,T,L){e.cancelPendingCommit=null;do Rs();while(xt!==0);if((Ve&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));if(d=n.lanes|n.childLanes,d|=Xc,bc(e,i,d,v,T,L),e===Pe&&(Re=Pe=null,De=0),yi=n,zr=e,ir=i,Wf=d,ed=c,gg=l,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,W2(Nt,function(){return Og(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||l){l=R.T,R.T=null,c=H.p,H.p=2,v=Ve,Ve|=4;try{G2(e,n,i)}finally{Ve=v,H.p=c,R.T=l}}xt=1,Ng(),Rg(),Mg()}}function Ng(){if(xt===1){xt=0;var e=zr,n=yi,i=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||i){i=R.T,R.T=null;var l=H.p;H.p=2;var c=Ve;Ve|=4;try{sg(n,e);var d=pd,v=mm(e.containerInfo),T=d.focusedElem,L=d.selectionRange;if(v!==T&&T&&T.ownerDocument&&hm(T.ownerDocument.documentElement,T)){if(L!==null&&Fc(T)){var Q=L.start,re=L.end;if(re===void 0&&(re=Q),"selectionStart"in T)T.selectionStart=Q,T.selectionEnd=Math.min(re,T.value.length);else{var le=T.ownerDocument||document,K=le&&le.defaultView||window;if(K.getSelection){var J=K.getSelection(),pe=T.textContent.length,_e=Math.min(L.start,pe),Ie=L.end===void 0?_e:Math.min(L.end,pe);!J.extend&&_e>Ie&&(v=Ie,Ie=_e,_e=v);var Y=dm(T,_e),G=dm(T,Ie);if(Y&&G&&(J.rangeCount!==1||J.anchorNode!==Y.node||J.anchorOffset!==Y.offset||J.focusNode!==G.node||J.focusOffset!==G.offset)){var Z=le.createRange();Z.setStart(Y.node,Y.offset),J.removeAllRanges(),_e>Ie?(J.addRange(Z),J.extend(G.node,G.offset)):(Z.setEnd(G.node,G.offset),J.addRange(Z))}}}}for(le=[],J=T;J=J.parentNode;)J.nodeType===1&&le.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<le.length;T++){var ie=le[T];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}Vs=!!md,pd=md=null}finally{Ve=c,H.p=l,R.T=i}}e.current=n,xt=2}}function Rg(){if(xt===2){xt=0;var e=zr,n=yi,i=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||i){i=R.T,R.T=null;var l=H.p;H.p=2;var c=Ve;Ve|=4;try{rg(e,n.alternate,n)}finally{Ve=c,H.p=l,R.T=i}}xt=3}}function Mg(){if(xt===4||xt===3){xt=0,Wt();var e=zr,n=yi,i=ir,l=gg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?xt=5:(xt=0,yi=zr=null,Dg(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Or=null),Zi(i),n=n.stateNode,Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(to,n,void 0,(n.current.flags&128)===128)}catch{}if(l!==null){n=R.T,c=H.p,H.p=2,R.T=null;try{for(var d=e.onRecoverableError,v=0;v<l.length;v++){var T=l[v];d(T.value,{componentStack:T.stack})}}finally{R.T=n,H.p=c}}(ir&3)!==0&&Rs(),Rn(e),c=e.pendingLanes,(i&261930)!==0&&(c&42)!==0?e===td?Ra++:(Ra=0,td=e):Ra=0,Ma(0)}}function Dg(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,ca(n)))}function Rs(){return Ng(),Rg(),Mg(),Og()}function Og(){if(xt!==5)return!1;var e=zr,n=Wf;Wf=0;var i=Zi(ir),l=R.T,c=H.p;try{H.p=32>i?32:i,R.T=null,i=ed,ed=null;var d=zr,v=ir;if(xt=0,yi=zr=null,ir=0,(Ve&6)!==0)throw Error(a(331));var T=Ve;if(Ve|=4,hg(d.current),cg(d,d.current,v,i),Ve=T,Ma(0,!1),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(to,d)}catch{}return!0}finally{H.p=c,R.T=l,Dg(e,n)}}function zg(e,n,i){n=tn(i,n),n=zf(e.stateNode,n,2),e=Tr(e,n,2),e!==null&&(ro(e,2),Rn(e))}function qe(e,n,i){if(e.tag===3)zg(e,e,i);else for(;n!==null;){if(n.tag===3){zg(n,e,i);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Or===null||!Or.has(l))){e=tn(i,e),i=Bp(2),l=Tr(n,i,2),l!==null&&(Up(i,l,n,e),ro(l,2),Rn(l));break}}n=n.return}}function od(e,n,i){var l=e.pingCache;if(l===null){l=e.pingCache=new Y2;var c=new Set;l.set(n,c)}else c=l.get(n),c===void 0&&(c=new Set,l.set(n,c));c.has(i)||(Qf=!0,c.add(i),e=Q2.bind(null,e,n,i),n.then(e,e))}function Q2(e,n,i){var l=e.pingCache;l!==null&&l.delete(n),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Pe===e&&(De&i)===i&&(ot===4||ot===3&&(De&62914560)===De&&300>at()-Ss?(Ve&2)===0&&xi(e,0):Kf|=i,gi===De&&(gi=0)),Rn(e)}function Bg(e,n){n===0&&(n=Al()),e=co(e,n),e!==null&&(ro(e,n),Rn(e))}function K2(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),Bg(e,i)}function J2(e,n){var i=0;switch(e.tag){case 31:case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(i=c.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(n),Bg(e,i)}function W2(e,n){return tt(e,n)}var Ms=null,bi=null,id=!1,Ds=!1,ad=!1,Ur=0;function Rn(e){e!==bi&&e.next===null&&(bi===null?Ms=bi=e:bi=bi.next=e),Ds=!0,id||(id=!0,tS())}function Ma(e,n){if(!ad&&Ds){ad=!0;do for(var i=!1,l=Ms;l!==null;){if(e!==0){var c=l.pendingLanes;if(c===0)var d=0;else{var v=l.suspendedLanes,T=l.pingedLanes;d=(1<<31-Mt(42|e)+1)-1,d&=c&~(v&~T),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(i=!0,jg(l,d))}else d=De,d=Go(l,l===Pe?d:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(d&3)===0||no(l,d)||(i=!0,jg(l,d));l=l.next}while(i);ad=!1}}function eS(){Ug()}function Ug(){Ds=id=!1;var e=0;Ur!==0&&fS()&&(e=Ur);for(var n=at(),i=null,l=Ms;l!==null;){var c=l.next,d=Hg(l,n);d===0?(l.next=null,i===null?Ms=c:i.next=c,c===null&&(bi=i)):(i=l,(e!==0||(d&3)!==0)&&(Ds=!0)),l=c}xt!==0&&xt!==5||Ma(e),Ur!==0&&(Ur=0)}function Hg(e,n){for(var i=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var v=31-Mt(d),T=1<<v,L=c[v];L===-1?((T&i)===0||(T&l)!==0)&&(c[v]=vc(T,n)):L<=n&&(e.expiredLanes|=T),d&=~T}if(n=Pe,i=De,i=Go(e,e===n?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,i===0||e===n&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&it(l),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||no(e,i)){if(n=i&-i,n===e.callbackPriority)return n;switch(l!==null&&it(l),Zi(i)){case 2:case 8:i=Sn;break;case 32:i=Nt;break;case 268435456:i=hr;break;default:i=Nt}return l=Lg.bind(null,e),i=tt(i,l),e.callbackPriority=n,e.callbackNode=i,n}return l!==null&&l!==null&&it(l),e.callbackPriority=2,e.callbackNode=null,2}function Lg(e,n){if(xt!==0&&xt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Rs()&&e.callbackNode!==i)return null;var l=De;return l=Go(e,e===Pe?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(xg(e,l,n),Hg(e,at()),e.callbackNode!=null&&e.callbackNode===i?Lg.bind(null,e):null)}function jg(e,n){if(Rs())return null;xg(e,n,!0)}function tS(){hS(function(){(Ve&6)!==0?tt(cn,eS):Ug()})}function ld(){if(Ur===0){var e=ii;e===0&&(e=Fo,Fo<<=1,(Fo&261888)===0&&(Fo=256)),Ur=e}return Ur}function Fg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Fl(""+e)}function kg(e,n){var i=n.ownerDocument.createElement("input");return i.name=n.name,i.value=n.value,e.id&&i.setAttribute("form",e.id),n.parentNode.insertBefore(i,n),e=new FormData(e),i.parentNode.removeChild(i),e}function nS(e,n,i,l,c){if(n==="submit"&&i&&i.stateNode===c){var d=Fg((c[At]||null).action),v=l.submitter;v&&(n=(n=v[At]||null)?Fg(n.formAction):v.getAttribute("formAction"),n!==null&&(d=n,v=null));var T=new ql("action","action",null,l,c);e.push({event:T,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ur!==0){var L=v?kg(c,v):new FormData(c);Cf(i,{pending:!0,data:L,method:c.method,action:d},null,L)}}else typeof d=="function"&&(T.preventDefault(),L=v?kg(c,v):new FormData(c),Cf(i,{pending:!0,data:L,method:c.method,action:d},d,L))},currentTarget:c}]})}}for(var sd=0;sd<qc.length;sd++){var ud=qc[sd],rS=ud.toLowerCase(),oS=ud[0].toUpperCase()+ud.slice(1);dn(rS,"on"+oS)}dn(ym,"onAnimationEnd"),dn(xm,"onAnimationIteration"),dn(vm,"onAnimationStart"),dn("dblclick","onDoubleClick"),dn("focusin","onFocus"),dn("focusout","onBlur"),dn(b2,"onTransitionRun"),dn(_2,"onTransitionStart"),dn(E2,"onTransitionCancel"),dn(bm,"onTransitionEnd"),xr("onMouseEnter",["mouseout","mouseover"]),xr("onMouseLeave",["mouseout","mouseover"]),xr("onPointerEnter",["pointerout","pointerover"]),xr("onPointerLeave",["pointerout","pointerover"]),Gn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Gn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Gn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Gn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Gn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Gn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Da="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),iS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Da));function Vg(e,n){n=(n&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],c=l.event;l=l.listeners;e:{var d=void 0;if(n)for(var v=l.length-1;0<=v;v--){var T=l[v],L=T.instance,Q=T.currentTarget;if(T=T.listener,L!==d&&c.isPropagationStopped())break e;d=T,c.currentTarget=Q;try{d(c)}catch(re){Il(re)}c.currentTarget=null,d=L}else for(v=0;v<l.length;v++){if(T=l[v],L=T.instance,Q=T.currentTarget,T=T.listener,L!==d&&c.isPropagationStopped())break e;d=T,c.currentTarget=Q;try{d(c)}catch(re){Il(re)}c.currentTarget=null,d=L}}}}function Me(e,n){var i=n[qo];i===void 0&&(i=n[qo]=new Set);var l=e+"__bubble";i.has(l)||(Gg(n,e,2,!1),i.add(l))}function cd(e,n,i){var l=0;n&&(l|=4),Gg(i,e,l,n)}var Os="_reactListening"+Math.random().toString(36).slice(2);function fd(e){if(!e[Os]){e[Os]=!0,zl.forEach(function(i){i!=="selectionchange"&&(iS.has(i)||cd(i,!1,e),cd(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Os]||(n[Os]=!0,cd("selectionchange",!1,n))}}function Gg(e,n,i,l){switch(yy(n)){case 2:var c=zS;break;case 8:c=BS;break;default:c=Td}i=c.bind(null,n,i,e),c=void 0,!Mc||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(c=!0),l?c!==void 0?e.addEventListener(n,i,{capture:!0,passive:c}):e.addEventListener(n,i,!0):c!==void 0?e.addEventListener(n,i,{passive:c}):e.addEventListener(n,i,!1)}function dd(e,n,i,l,c){var d=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var v=l.tag;if(v===3||v===4){var T=l.stateNode.containerInfo;if(T===c)break;if(v===4)for(v=l.return;v!==null;){var L=v.tag;if((L===3||L===4)&&v.stateNode.containerInfo===c)return;v=v.return}for(;T!==null;){if(v=mr(T),v===null)return;if(L=v.tag,L===5||L===6||L===26||L===27){l=d=v;continue e}T=T.parentNode}}l=l.return}P0(function(){var Q=d,re=Nc(i),le=[];e:{var K=_m.get(e);if(K!==void 0){var J=ql,pe=e;switch(e){case"keypress":if(Vl(i)===0)break e;case"keydown":case"keyup":J=JE;break;case"focusin":pe="focus",J=Bc;break;case"focusout":pe="blur",J=Bc;break;case"beforeblur":case"afterblur":J=Bc;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=Q0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=kE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=t2;break;case ym:case xm:case vm:J=qE;break;case bm:J=r2;break;case"scroll":case"scrollend":J=jE;break;case"wheel":J=i2;break;case"copy":case"cut":case"paste":J=YE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=J0;break;case"toggle":case"beforetoggle":J=l2}var _e=(n&4)!==0,Ie=!_e&&(e==="scroll"||e==="scrollend"),Y=_e?K!==null?K+"Capture":null:K;_e=[];for(var G=Q,Z;G!==null;){var ie=G;if(Z=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||Z===null||Y===null||(ie=Wi(G,Y),ie!=null&&_e.push(Oa(G,ie,Z))),Ie)break;G=G.return}0<_e.length&&(K=new J(K,pe,null,i,re),le.push({event:K,listeners:_e}))}}if((n&7)===0){e:{if(K=e==="mouseover"||e==="pointerover",J=e==="mouseout"||e==="pointerout",K&&i!==Cc&&(pe=i.relatedTarget||i.fromElement)&&(mr(pe)||pe[Vn]))break e;if((J||K)&&(K=re.window===re?re:(K=re.ownerDocument)?K.defaultView||K.parentWindow:window,J?(pe=i.relatedTarget||i.toElement,J=Q,pe=pe?mr(pe):null,pe!==null&&(Ie=u(pe),_e=pe.tag,pe!==Ie||_e!==5&&_e!==27&&_e!==6)&&(pe=null)):(J=null,pe=Q),J!==pe)){if(_e=Q0,ie="onMouseLeave",Y="onMouseEnter",G="mouse",(e==="pointerout"||e==="pointerover")&&(_e=J0,ie="onPointerLeave",Y="onPointerEnter",G="pointer"),Ie=J==null?K:gr(J),Z=pe==null?K:gr(pe),K=new _e(ie,G+"leave",J,i,re),K.target=Ie,K.relatedTarget=Z,ie=null,mr(re)===Q&&(_e=new _e(Y,G+"enter",pe,i,re),_e.target=Z,_e.relatedTarget=Ie,ie=_e),Ie=ie,J&&pe)t:{for(_e=aS,Y=J,G=pe,Z=0,ie=Y;ie;ie=_e(ie))Z++;ie=0;for(var ve=G;ve;ve=_e(ve))ie++;for(;0<Z-ie;)Y=_e(Y),Z--;for(;0<ie-Z;)G=_e(G),ie--;for(;Z--;){if(Y===G||G!==null&&Y===G.alternate){_e=Y;break t}Y=_e(Y),G=_e(G)}_e=null}else _e=null;J!==null&&qg(le,K,J,_e,!1),pe!==null&&Ie!==null&&qg(le,Ie,pe,_e,!0)}}e:{if(K=Q?gr(Q):window,J=K.nodeName&&K.nodeName.toLowerCase(),J==="select"||J==="input"&&K.type==="file")var Fe=am;else if(om(K))if(lm)Fe=y2;else{Fe=p2;var ye=m2}else J=K.nodeName,!J||J.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?Q&&Tc(Q.elementType)&&(Fe=am):Fe=g2;if(Fe&&(Fe=Fe(e,Q))){im(le,Fe,i,re);break e}ye&&ye(e,K,Q),e==="focusout"&&Q&&K.type==="number"&&Q.memoizedProps.value!=null&&Ji(K,"number",K.value)}switch(ye=Q?gr(Q):window,e){case"focusin":(om(ye)||ye.contentEditable==="true")&&(Ko=ye,kc=Q,la=null);break;case"focusout":la=kc=Ko=null;break;case"mousedown":Vc=!0;break;case"contextmenu":case"mouseup":case"dragend":Vc=!1,pm(le,i,re);break;case"selectionchange":if(v2)break;case"keydown":case"keyup":pm(le,i,re)}var Ne;if(Hc)e:{switch(e){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else Qo?nm(e,i)&&(Oe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Oe="onCompositionStart");Oe&&(W0&&i.locale!=="ko"&&(Qo||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&Qo&&(Ne=$0()):(vr=re,Dc="value"in vr?vr.value:vr.textContent,Qo=!0)),ye=zs(Q,Oe),0<ye.length&&(Oe=new K0(Oe,e,null,i,re),le.push({event:Oe,listeners:ye}),Ne?Oe.data=Ne:(Ne=rm(i),Ne!==null&&(Oe.data=Ne)))),(Ne=u2?c2(e,i):f2(e,i))&&(Oe=zs(Q,"onBeforeInput"),0<Oe.length&&(ye=new K0("onBeforeInput","beforeinput",null,i,re),le.push({event:ye,listeners:Oe}),ye.data=Ne)),nS(le,e,Q,i,re)}Vg(le,n)})}function Oa(e,n,i){return{instance:e,listener:n,currentTarget:i}}function zs(e,n){for(var i=n+"Capture",l=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=Wi(e,i),c!=null&&l.unshift(Oa(e,c,d)),c=Wi(e,n),c!=null&&l.push(Oa(e,c,d))),e.tag===3)return l;e=e.return}return[]}function aS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function qg(e,n,i,l,c){for(var d=n._reactName,v=[];i!==null&&i!==l;){var T=i,L=T.alternate,Q=T.stateNode;if(T=T.tag,L!==null&&L===l)break;T!==5&&T!==26&&T!==27||Q===null||(L=Q,c?(Q=Wi(i,d),Q!=null&&v.unshift(Oa(i,Q,L))):c||(Q=Wi(i,d),Q!=null&&v.push(Oa(i,Q,L)))),i=i.return}v.length!==0&&e.push({event:n,listeners:v})}var lS=/\r\n?/g,sS=/\u0000|\uFFFD/g;function Xg(e){return(typeof e=="string"?e:""+e).replace(lS,`
|
|
9
|
+
`).replace(sS,"")}function Yg(e,n){return n=Xg(n),Xg(e)===n}function Ye(e,n,i,l,c,d){switch(i){case"children":typeof l=="string"?n==="body"||n==="textarea"&&l===""||Po(e,l):(typeof l=="number"||typeof l=="bigint")&&n!=="body"&&Po(e,""+l);break;case"className":Yo(e,"class",l);break;case"tabIndex":Yo(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Yo(e,i,l);break;case"style":Y0(e,l,d);break;case"data":if(n!=="object"){Yo(e,"data",l);break}case"src":case"href":if(l===""&&(n!=="a"||i!=="href")){e.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Fl(""+l),e.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(i==="formAction"?(n!=="input"&&Ye(e,n,"name",c.name,c,null),Ye(e,n,"formEncType",c.formEncType,c,null),Ye(e,n,"formMethod",c.formMethod,c,null),Ye(e,n,"formTarget",c.formTarget,c,null)):(Ye(e,n,"encType",c.encType,c,null),Ye(e,n,"method",c.method,c,null),Ye(e,n,"target",c.target,c,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Fl(""+l),e.setAttribute(i,l);break;case"onClick":l!=null&&(e.onclick=Xn);break;case"onScroll":l!=null&&Me("scroll",e);break;case"onScrollEnd":l!=null&&Me("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(i=l.__html,i!=null){if(c.children!=null)throw Error(a(60));e.innerHTML=i}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}i=Fl(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""+l):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":l===!0?e.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,l):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(i,l):e.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(i):e.setAttribute(i,l);break;case"popover":Me("beforetoggle",e),Me("toggle",e),Xo(e,"popover",l);break;case"xlinkActuate":fn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":fn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":fn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":fn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":fn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":fn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":fn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":fn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":fn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Xo(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=HE.get(i)||i,Xo(e,i,l))}}function hd(e,n,i,l,c,d){switch(i){case"style":Y0(e,l,d);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(i=l.__html,i!=null){if(c.children!=null)throw Error(a(60));e.innerHTML=i}}break;case"children":typeof l=="string"?Po(e,l):(typeof l=="number"||typeof l=="bigint")&&Po(e,""+l);break;case"onScroll":l!=null&&Me("scroll",e);break;case"onScrollEnd":l!=null&&Me("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Xn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Bl.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(c=i.endsWith("Capture"),n=i.slice(2,c?i.length-7:void 0),d=e[At]||null,d=d!=null?d[i]:null,typeof d=="function"&&e.removeEventListener(n,d,c),typeof l=="function")){typeof d!="function"&&d!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(n,l,c);break e}i in e?e[i]=l:l===!0?e.setAttribute(i,""):Xo(e,i,l)}}}function wt(e,n,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",e),Me("load",e);var l=!1,c=!1,d;for(d in i)if(i.hasOwnProperty(d)){var v=i[d];if(v!=null)switch(d){case"src":l=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Ye(e,n,d,v,i,null)}}c&&Ye(e,n,"srcSet",i.srcSet,i,null),l&&Ye(e,n,"src",i.src,i,null);return;case"input":Me("invalid",e);var T=d=v=c=null,L=null,Q=null;for(l in i)if(i.hasOwnProperty(l)){var re=i[l];if(re!=null)switch(l){case"name":c=re;break;case"type":v=re;break;case"checked":L=re;break;case"defaultChecked":Q=re;break;case"value":d=re;break;case"defaultValue":T=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,n));break;default:Ye(e,n,l,re,i,null)}}jl(e,d,T,L,Q,v,c,!1);return;case"select":Me("invalid",e),l=v=d=null;for(c in i)if(i.hasOwnProperty(c)&&(T=i[c],T!=null))switch(c){case"value":d=T;break;case"defaultValue":v=T;break;case"multiple":l=T;default:Ye(e,n,c,T,i,null)}n=d,i=v,e.multiple=!!l,n!=null?qn(e,!!l,n,!1):i!=null&&qn(e,!!l,i,!0);return;case"textarea":Me("invalid",e),d=c=l=null;for(v in i)if(i.hasOwnProperty(v)&&(T=i[v],T!=null))switch(v){case"value":l=T;break;case"defaultValue":c=T;break;case"children":d=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(a(91));break;default:Ye(e,n,v,T,i,null)}q0(e,l,c,d);return;case"option":for(L in i)i.hasOwnProperty(L)&&(l=i[L],l!=null)&&(L==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":Ye(e,n,L,l,i,null));return;case"dialog":Me("beforetoggle",e),Me("toggle",e),Me("cancel",e),Me("close",e);break;case"iframe":case"object":Me("load",e);break;case"video":case"audio":for(l=0;l<Da.length;l++)Me(Da[l],e);break;case"image":Me("error",e),Me("load",e);break;case"details":Me("toggle",e);break;case"embed":case"source":case"link":Me("error",e),Me("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Q in i)if(i.hasOwnProperty(Q)&&(l=i[Q],l!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Ye(e,n,Q,l,i,null)}return;default:if(Tc(n)){for(re in i)i.hasOwnProperty(re)&&(l=i[re],l!==void 0&&hd(e,n,re,l,i,void 0));return}}for(T in i)i.hasOwnProperty(T)&&(l=i[T],l!=null&&Ye(e,n,T,l,i,null))}function uS(e,n,i,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,v=null,T=null,L=null,Q=null,re=null;for(J in i){var le=i[J];if(i.hasOwnProperty(J)&&le!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":L=le;default:l.hasOwnProperty(J)||Ye(e,n,J,null,l,le)}}for(var K in l){var J=l[K];if(le=i[K],l.hasOwnProperty(K)&&(J!=null||le!=null))switch(K){case"type":d=J;break;case"name":c=J;break;case"checked":Q=J;break;case"defaultChecked":re=J;break;case"value":v=J;break;case"defaultValue":T=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,n));break;default:J!==le&&Ye(e,n,K,J,l,le)}}ao(e,v,T,L,Q,re,d,c);return;case"select":J=v=T=K=null;for(d in i)if(L=i[d],i.hasOwnProperty(d)&&L!=null)switch(d){case"value":break;case"multiple":J=L;default:l.hasOwnProperty(d)||Ye(e,n,d,null,l,L)}for(c in l)if(d=l[c],L=i[c],l.hasOwnProperty(c)&&(d!=null||L!=null))switch(c){case"value":K=d;break;case"defaultValue":T=d;break;case"multiple":v=d;default:d!==L&&Ye(e,n,c,d,l,L)}n=T,i=v,l=J,K!=null?qn(e,!!i,K,!1):!!l!=!!i&&(n!=null?qn(e,!!i,n,!0):qn(e,!!i,i?[]:"",!1));return;case"textarea":J=K=null;for(T in i)if(c=i[T],i.hasOwnProperty(T)&&c!=null&&!l.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:Ye(e,n,T,null,l,c)}for(v in l)if(c=l[v],d=i[v],l.hasOwnProperty(v)&&(c!=null||d!=null))switch(v){case"value":K=c;break;case"defaultValue":J=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(a(91));break;default:c!==d&&Ye(e,n,v,c,l,d)}G0(e,K,J);return;case"option":for(var pe in i)K=i[pe],i.hasOwnProperty(pe)&&K!=null&&!l.hasOwnProperty(pe)&&(pe==="selected"?e.selected=!1:Ye(e,n,pe,null,l,K));for(L in l)K=l[L],J=i[L],l.hasOwnProperty(L)&&K!==J&&(K!=null||J!=null)&&(L==="selected"?e.selected=K&&typeof K!="function"&&typeof K!="symbol":Ye(e,n,L,K,l,J));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _e in i)K=i[_e],i.hasOwnProperty(_e)&&K!=null&&!l.hasOwnProperty(_e)&&Ye(e,n,_e,null,l,K);for(Q in l)if(K=l[Q],J=i[Q],l.hasOwnProperty(Q)&&K!==J&&(K!=null||J!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(a(137,n));break;default:Ye(e,n,Q,K,l,J)}return;default:if(Tc(n)){for(var Ie in i)K=i[Ie],i.hasOwnProperty(Ie)&&K!==void 0&&!l.hasOwnProperty(Ie)&&hd(e,n,Ie,void 0,l,K);for(re in l)K=l[re],J=i[re],!l.hasOwnProperty(re)||K===J||K===void 0&&J===void 0||hd(e,n,re,K,l,J);return}}for(var Y in i)K=i[Y],i.hasOwnProperty(Y)&&K!=null&&!l.hasOwnProperty(Y)&&Ye(e,n,Y,null,l,K);for(le in l)K=l[le],J=i[le],!l.hasOwnProperty(le)||K===J||K==null&&J==null||Ye(e,n,le,K,l,J)}function Ig(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function cS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var c=i[l],d=c.transferSize,v=c.initiatorType,T=c.duration;if(d&&T&&Ig(v)){for(v=0,T=c.responseEnd,l+=1;l<i.length;l++){var L=i[l],Q=L.startTime;if(Q>T)break;var re=L.transferSize,le=L.initiatorType;re&&Ig(le)&&(L=L.responseEnd,v+=re*(L<T?1:(T-Q)/(L-Q)))}if(--l,n+=8*(d+v)/(c.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var md=null,pd=null;function Bs(e){return e.nodeType===9?e:e.ownerDocument}function Pg(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function $g(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function gd(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var yd=null;function fS(){var e=window.event;return e&&e.type==="popstate"?e===yd?!1:(yd=e,!0):(yd=null,!1)}var Zg=typeof setTimeout=="function"?setTimeout:void 0,dS=typeof clearTimeout=="function"?clearTimeout:void 0,Qg=typeof Promise=="function"?Promise:void 0,hS=typeof queueMicrotask=="function"?queueMicrotask:typeof Qg<"u"?function(e){return Qg.resolve(null).then(e).catch(mS)}:Zg;function mS(e){setTimeout(function(){throw e})}function Hr(e){return e==="head"}function Kg(e,n){var i=n,l=0;do{var c=i.nextSibling;if(e.removeChild(i),c&&c.nodeType===8)if(i=c.data,i==="/$"||i==="/&"){if(l===0){e.removeChild(c),wi(n);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")za(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,za(i);for(var d=i.firstChild;d;){var v=d.nextSibling,T=d.nodeName;d[oo]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&d.rel.toLowerCase()==="stylesheet"||i.removeChild(d),d=v}}else i==="body"&&za(e.ownerDocument.body);i=c}while(i);wi(n)}function Jg(e,n){var i=e;e=0;do{var l=i.nextSibling;if(i.nodeType===1?n?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(n?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=l}while(i)}function xd(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var i=n;switch(n=n.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":xd(i),Qi(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function pS(e,n,i,l){for(;e.nodeType===1;){var c=i;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[oo])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=ln(e.nextSibling),e===null)break}return null}function gS(e,n,i){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=ln(e.nextSibling),e===null))return null;return e}function Wg(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ln(e.nextSibling),e===null))return null;return e}function vd(e){return e.data==="$?"||e.data==="$~"}function bd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function yS(e,n){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||i.readyState!=="loading")n();else{var l=function(){n(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function ln(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var _d=null;function ey(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(n===0)return ln(e.nextSibling);n--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||n++}e=e.nextSibling}return null}function ty(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(n===0)return e;n--}else i!=="/$"&&i!=="/&"||n++}e=e.previousSibling}return null}function ny(e,n,i){switch(n=Bs(i),e){case"html":if(e=n.documentElement,!e)throw Error(a(452));return e;case"head":if(e=n.head,!e)throw Error(a(453));return e;case"body":if(e=n.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function za(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Qi(e)}var sn=new Map,ry=new Set;function Us(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ar=H.d;H.d={f:xS,r:vS,D:bS,C:_S,L:ES,m:SS,X:AS,S:wS,M:TS};function xS(){var e=ar.f(),n=Ts();return e||n}function vS(e){var n=pr(e);n!==null&&n.tag===5&&n.type==="form"?bp(n):ar.r(e)}var _i=typeof document>"u"?null:document;function oy(e,n,i){var l=_i;if(l&&typeof n=="string"&&n){var c=Ut(n);c='link[rel="'+e+'"][href="'+c+'"]',typeof i=="string"&&(c+='[crossorigin="'+i+'"]'),ry.has(c)||(ry.add(c),e={rel:e,crossOrigin:i,href:n},l.querySelector(c)===null&&(n=l.createElement("link"),wt(n,"link",e),ut(n),l.head.appendChild(n)))}}function bS(e){ar.D(e),oy("dns-prefetch",e,null)}function _S(e,n){ar.C(e,n),oy("preconnect",e,n)}function ES(e,n,i){ar.L(e,n,i);var l=_i;if(l&&e&&n){var c='link[rel="preload"][as="'+Ut(n)+'"]';n==="image"&&i&&i.imageSrcSet?(c+='[imagesrcset="'+Ut(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(c+='[imagesizes="'+Ut(i.imageSizes)+'"]')):c+='[href="'+Ut(e)+'"]';var d=c;switch(n){case"style":d=Ei(e);break;case"script":d=Si(e)}sn.has(d)||(e=g({rel:"preload",href:n==="image"&&i&&i.imageSrcSet?void 0:e,as:n},i),sn.set(d,e),l.querySelector(c)!==null||n==="style"&&l.querySelector(Ba(d))||n==="script"&&l.querySelector(Ua(d))||(n=l.createElement("link"),wt(n,"link",e),ut(n),l.head.appendChild(n)))}}function SS(e,n){ar.m(e,n);var i=_i;if(i&&e){var l=n&&typeof n.as=="string"?n.as:"script",c='link[rel="modulepreload"][as="'+Ut(l)+'"][href="'+Ut(e)+'"]',d=c;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Si(e)}if(!sn.has(d)&&(e=g({rel:"modulepreload",href:e},n),sn.set(d,e),i.querySelector(c)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Ua(d)))return}l=i.createElement("link"),wt(l,"link",e),ut(l),i.head.appendChild(l)}}}function wS(e,n,i){ar.S(e,n,i);var l=_i;if(l&&e){var c=yr(l).hoistableStyles,d=Ei(e);n=n||"default";var v=c.get(d);if(!v){var T={loading:0,preload:null};if(v=l.querySelector(Ba(d)))T.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":n},i),(i=sn.get(d))&&Ed(e,i);var L=v=l.createElement("link");ut(L),wt(L,"link",e),L._p=new Promise(function(Q,re){L.onload=Q,L.onerror=re}),L.addEventListener("load",function(){T.loading|=1}),L.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Hs(v,n,l)}v={type:"stylesheet",instance:v,count:1,state:T},c.set(d,v)}}}function AS(e,n){ar.X(e,n);var i=_i;if(i&&e){var l=yr(i).hoistableScripts,c=Si(e),d=l.get(c);d||(d=i.querySelector(Ua(c)),d||(e=g({src:e,async:!0},n),(n=sn.get(c))&&Sd(e,n),d=i.createElement("script"),ut(d),wt(d,"link",e),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(c,d))}}function TS(e,n){ar.M(e,n);var i=_i;if(i&&e){var l=yr(i).hoistableScripts,c=Si(e),d=l.get(c);d||(d=i.querySelector(Ua(c)),d||(e=g({src:e,async:!0,type:"module"},n),(n=sn.get(c))&&Sd(e,n),d=i.createElement("script"),ut(d),wt(d,"link",e),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(c,d))}}function iy(e,n,i,l){var c=(c=he.current)?Us(c):null;if(!c)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(n=Ei(i.href),i=yr(c).hoistableStyles,l=i.get(n),l||(l={type:"style",instance:null,count:0,state:null},i.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Ei(i.href);var d=yr(c).hoistableStyles,v=d.get(e);if(v||(c=c.ownerDocument||c,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,v),(d=c.querySelector(Ba(e)))&&!d._p&&(v.instance=d,v.state.loading=5),sn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},sn.set(e,i),d||CS(c,e,i,v.state))),n&&l===null)throw Error(a(528,""));return v}if(n&&l!==null)throw Error(a(529,""));return null;case"script":return n=i.async,i=i.src,typeof i=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Si(i),i=yr(c).hoistableScripts,l=i.get(n),l||(l={type:"script",instance:null,count:0,state:null},i.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Ei(e){return'href="'+Ut(e)+'"'}function Ba(e){return'link[rel="stylesheet"]['+e+"]"}function ay(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function CS(e,n,i,l){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?l.loading=1:(n=e.createElement("link"),l.preload=n,n.addEventListener("load",function(){return l.loading|=1}),n.addEventListener("error",function(){return l.loading|=2}),wt(n,"link",i),ut(n),e.head.appendChild(n))}function Si(e){return'[src="'+Ut(e)+'"]'}function Ua(e){return"script[async]"+e}function ly(e,n,i){if(n.count++,n.instance===null)switch(n.type){case"style":var l=e.querySelector('style[data-href~="'+Ut(i.href)+'"]');if(l)return n.instance=l,ut(l),l;var c=g({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),ut(l),wt(l,"style",c),Hs(l,i.precedence,e),n.instance=l;case"stylesheet":c=Ei(i.href);var d=e.querySelector(Ba(c));if(d)return n.state.loading|=4,n.instance=d,ut(d),d;l=ay(i),(c=sn.get(c))&&Ed(l,c),d=(e.ownerDocument||e).createElement("link"),ut(d);var v=d;return v._p=new Promise(function(T,L){v.onload=T,v.onerror=L}),wt(d,"link",l),n.state.loading|=4,Hs(d,i.precedence,e),n.instance=d;case"script":return d=Si(i.src),(c=e.querySelector(Ua(d)))?(n.instance=c,ut(c),c):(l=i,(c=sn.get(d))&&(l=g({},i),Sd(l,c)),e=e.ownerDocument||e,c=e.createElement("script"),ut(c),wt(c,"link",l),e.head.appendChild(c),n.instance=c);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,Hs(l,i.precedence,e));return n.instance}function Hs(e,n,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=l.length?l[l.length-1]:null,d=c,v=0;v<l.length;v++){var T=l[v];if(T.dataset.precedence===n)d=T;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(n=i.nodeType===9?i.head:i,n.insertBefore(e,n.firstChild))}function Ed(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Sd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Ls=null;function sy(e,n,i){if(Ls===null){var l=new Map,c=Ls=new Map;c.set(i,l)}else c=Ls,l=c.get(i),l||(l=new Map,c.set(i,l));if(l.has(e))return l;for(l.set(e,null),i=i.getElementsByTagName(e),c=0;c<i.length;c++){var d=i[c];if(!(d[oo]||d[yt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var v=d.getAttribute(n)||"";v=e+v;var T=l.get(v);T?T.push(d):l.set(v,[d])}}return l}function uy(e,n,i){e=e.ownerDocument||e,e.head.insertBefore(i,n==="title"?e.querySelector("head > title"):null)}function NS(e,n,i){if(i===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function cy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function RS(e,n,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var c=Ei(l.href),d=n.querySelector(Ba(c));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=js.bind(e),n.then(e,e)),i.state.loading|=4,i.instance=d,ut(d);return}d=n.ownerDocument||n,l=ay(l),(c=sn.get(c))&&Ed(l,c),d=d.createElement("link"),ut(d);var v=d;v._p=new Promise(function(T,L){v.onload=T,v.onerror=L}),wt(d,"link",l),i.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,n),(n=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=js.bind(e),n.addEventListener("load",i),n.addEventListener("error",i))}}var wd=0;function MS(e,n){return e.stylesheets&&e.count===0&&ks(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var l=setTimeout(function(){if(e.stylesheets&&ks(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+n);0<e.imgBytes&&wd===0&&(wd=62500*cS());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ks(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>wd?50:800)+n);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(c)}}:null}function js(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ks(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Fs=null;function ks(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Fs=new Map,n.forEach(DS,e),Fs=null,js.call(e))}function DS(e,n){if(!(n.state.loading&4)){var i=Fs.get(e);if(i)var l=i.get(null);else{i=new Map,Fs.set(e,i);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var v=c[d];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(i.set(v.dataset.precedence,v),l=v)}l&&i.set(null,l)}c=n.instance,v=c.getAttribute("data-precedence"),d=i.get(v)||l,d===l&&i.set(null,c),i.set(v,c),this.count++,l=js.bind(this),c.addEventListener("load",l),c.addEventListener("error",l),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),n.state.loading|=4}}var Ha={$$typeof:S,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function OS(e,n,i,l,c,d,v,T,L){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Pi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pi(0),this.hiddenUpdates=Pi(null),this.identifierPrefix=l,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function fy(e,n,i,l,c,d,v,T,L,Q,re,le){return e=new OS(e,n,i,v,L,Q,re,le,T),n=1,d===!0&&(n|=24),d=Xt(3,null,null,n),e.current=d,d.stateNode=e,n=nf(),n.refCount++,e.pooledCache=n,n.refCount++,d.memoizedState={element:l,isDehydrated:i,cache:n},lf(d),e}function dy(e){return e?(e=ei,e):ei}function hy(e,n,i,l,c,d){c=dy(c),l.context===null?l.context=c:l.pendingContext=c,l=Ar(n),l.payload={element:i},d=d===void 0?null:d,d!==null&&(l.callback=d),i=Tr(e,l,n),i!==null&&(Vt(i,e,n),ma(i,e,n))}function my(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<n?i:n}}function Ad(e,n){my(e,n),(e=e.alternate)&&my(e,n)}function py(e){if(e.tag===13||e.tag===31){var n=co(e,67108864);n!==null&&Vt(n,e,67108864),Ad(e,67108864)}}function gy(e){if(e.tag===13||e.tag===31){var n=Zt();n=$i(n);var i=co(e,n);i!==null&&Vt(i,e,n),Ad(e,n)}}var Vs=!0;function zS(e,n,i,l){var c=R.T;R.T=null;var d=H.p;try{H.p=2,Td(e,n,i,l)}finally{H.p=d,R.T=c}}function BS(e,n,i,l){var c=R.T;R.T=null;var d=H.p;try{H.p=8,Td(e,n,i,l)}finally{H.p=d,R.T=c}}function Td(e,n,i,l){if(Vs){var c=Cd(l);if(c===null)dd(e,n,l,Gs,i),xy(e,l);else if(HS(c,e,n,i,l))l.stopPropagation();else if(xy(e,l),n&4&&-1<US.indexOf(e)){for(;c!==null;){var d=pr(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var v=kn(d.pendingLanes);if(v!==0){var T=d;for(T.pendingLanes|=2,T.entangledLanes|=2;v;){var L=1<<31-Mt(v);T.entanglements[1]|=L,v&=~L}Rn(d),(Ve&6)===0&&(ws=at()+500,Ma(0))}}break;case 31:case 13:T=co(d,2),T!==null&&Vt(T,d,2),Ts(),Ad(d,2)}if(d=Cd(l),d===null&&dd(e,n,l,Gs,i),d===c)break;c=d}c!==null&&l.stopPropagation()}else dd(e,n,l,null,i)}}function Cd(e){return e=Nc(e),Nd(e)}var Gs=null;function Nd(e){if(Gs=null,e=mr(e),e!==null){var n=u(e);if(n===null)e=null;else{var i=n.tag;if(i===13){if(e=f(n),e!==null)return e;e=null}else if(i===31){if(e=h(n),e!==null)return e;e=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Gs=e,null}function yy(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Wr()){case cn:return 2;case Sn:return 8;case Nt:case eo:return 32;case hr:return 268435456;default:return 32}default:return 32}}var Rd=!1,Lr=null,jr=null,Fr=null,La=new Map,ja=new Map,kr=[],US="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function xy(e,n){switch(e){case"focusin":case"focusout":Lr=null;break;case"dragenter":case"dragleave":jr=null;break;case"mouseover":case"mouseout":Fr=null;break;case"pointerover":case"pointerout":La.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":ja.delete(n.pointerId)}}function Fa(e,n,i,l,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:n,domEventName:i,eventSystemFlags:l,nativeEvent:d,targetContainers:[c]},n!==null&&(n=pr(n),n!==null&&py(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,c!==null&&n.indexOf(c)===-1&&n.push(c),e)}function HS(e,n,i,l,c){switch(n){case"focusin":return Lr=Fa(Lr,e,n,i,l,c),!0;case"dragenter":return jr=Fa(jr,e,n,i,l,c),!0;case"mouseover":return Fr=Fa(Fr,e,n,i,l,c),!0;case"pointerover":var d=c.pointerId;return La.set(d,Fa(La.get(d)||null,e,n,i,l,c)),!0;case"gotpointercapture":return d=c.pointerId,ja.set(d,Fa(ja.get(d)||null,e,n,i,l,c)),!0}return!1}function vy(e){var n=mr(e.target);if(n!==null){var i=u(n);if(i!==null){if(n=i.tag,n===13){if(n=f(i),n!==null){e.blockedOn=n,Ml(e.priority,function(){gy(i)});return}}else if(n===31){if(n=h(i),n!==null){e.blockedOn=n,Ml(e.priority,function(){gy(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function qs(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=Cd(e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);Cc=l,i.target.dispatchEvent(l),Cc=null}else return n=pr(i),n!==null&&py(n),e.blockedOn=i,!1;n.shift()}return!0}function by(e,n,i){qs(e)&&i.delete(n)}function LS(){Rd=!1,Lr!==null&&qs(Lr)&&(Lr=null),jr!==null&&qs(jr)&&(jr=null),Fr!==null&&qs(Fr)&&(Fr=null),La.forEach(by),ja.forEach(by)}function Xs(e,n){e.blockedOn===n&&(e.blockedOn=null,Rd||(Rd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,LS)))}var Ys=null;function _y(e){Ys!==e&&(Ys=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ys===e&&(Ys=null);for(var n=0;n<e.length;n+=3){var i=e[n],l=e[n+1],c=e[n+2];if(typeof l!="function"){if(Nd(l||i)===null)continue;break}var d=pr(i);d!==null&&(e.splice(n,3),n-=3,Cf(d,{pending:!0,data:c,method:i.method,action:l},l,c))}}))}function wi(e){function n(L){return Xs(L,e)}Lr!==null&&Xs(Lr,e),jr!==null&&Xs(jr,e),Fr!==null&&Xs(Fr,e),La.forEach(n),ja.forEach(n);for(var i=0;i<kr.length;i++){var l=kr[i];l.blockedOn===e&&(l.blockedOn=null)}for(;0<kr.length&&(i=kr[0],i.blockedOn===null);)vy(i),i.blockedOn===null&&kr.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var c=i[l],d=i[l+1],v=c[At]||null;if(typeof d=="function")v||_y(i);else if(v){var T=null;if(d&&d.hasAttribute("formAction")){if(c=d,v=d[At]||null)T=v.formAction;else if(Nd(c)!==null)continue}else T=v.action;typeof T=="function"?i[l+1]=T:(i.splice(l,3),l-=3),_y(i)}}}function Ey(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(v){return c=v})},focusReset:"manual",scroll:"manual"})}function n(){c!==null&&(c(),c=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),c!==null&&(c(),c=null)}}}function Md(e){this._internalRoot=e}Is.prototype.render=Md.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var i=n.current,l=Zt();hy(i,l,e,n,null,null)},Is.prototype.unmount=Md.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;hy(e.current,2,null,e,null,null),Ts(),n[Vn]=null}};function Is(e){this._internalRoot=e}Is.prototype.unstable_scheduleHydration=function(e){if(e){var n=Rl();e={blockedOn:null,target:e,priority:n};for(var i=0;i<kr.length&&n!==0&&n<kr[i].priority;i++);kr.splice(i,0,e),i===0&&vy(e)}};var Sy=r.version;if(Sy!=="19.2.4")throw Error(a(527,Sy,"19.2.4"));H.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=m(n),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var jS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ps=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ps.isDisabled&&Ps.supportsFiber)try{to=Ps.inject(jS),Rt=Ps}catch{}}return Va.createRoot=function(e,n){if(!s(e))throw Error(a(299));var i=!1,l="",c=Mp,d=Dp,v=Op;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=fy(e,1,!1,null,null,i,l,null,c,d,v,Ey),e[Vn]=n.current,fd(e),new Md(n)},Va.hydrateRoot=function(e,n,i){if(!s(e))throw Error(a(299));var l=!1,c="",d=Mp,v=Dp,T=Op,L=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(d=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(T=i.onRecoverableError),i.formState!==void 0&&(L=i.formState)),n=fy(e,1,!0,n,i??null,l,c,L,d,v,T,Ey),n.context=dy(null),i=n.current,l=Zt(),l=$i(l),c=Ar(l),c.callback=null,Tr(i,c,l),i=l,n.current.lanes=i,ro(n,i),Rn(n),e[Vn]=n.current,fd(e),new Is(n)},Va.version="19.2.4",Va}var zy;function $S(){if(zy)return zd.exports;zy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),zd.exports=PS(),zd.exports}var ZS=$S();const Bn=Object.create(null);Bn.open="0";Bn.close="1";Bn.ping="2";Bn.pong="3";Bn.message="4";Bn.upgrade="5";Bn.noop="6";const du=Object.create(null);Object.keys(Bn).forEach(t=>{du[Bn[t]]=t});const sh={type:"error",data:"parser error"},vv=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",bv=typeof ArrayBuffer=="function",_v=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Lh=({type:t,data:r},o,a)=>vv&&r instanceof Blob?o?a(r):By(r,a):bv&&(r instanceof ArrayBuffer||_v(r))?o?a(r):By(new Blob([r]),a):a(Bn[t]+(r||"")),By=(t,r)=>{const o=new FileReader;return o.onload=function(){const a=o.result.split(",")[1];r("b"+(a||""))},o.readAsDataURL(t)};function Uy(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Ld;function QS(t,r){if(vv&&t.data instanceof Blob)return t.data.arrayBuffer().then(Uy).then(r);if(bv&&(t.data instanceof ArrayBuffer||_v(t.data)))return r(Uy(t.data));Lh(t,!1,o=>{Ld||(Ld=new TextEncoder),r(Ld.encode(o))})}const Hy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$a=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<Hy.length;t++)$a[Hy.charCodeAt(t)]=t;const KS=t=>{let r=t.length*.75,o=t.length,a,s=0,u,f,h,p;t[t.length-1]==="="&&(r--,t[t.length-2]==="="&&r--);const m=new ArrayBuffer(r),y=new Uint8Array(m);for(a=0;a<o;a+=4)u=$a[t.charCodeAt(a)],f=$a[t.charCodeAt(a+1)],h=$a[t.charCodeAt(a+2)],p=$a[t.charCodeAt(a+3)],y[s++]=u<<2|f>>4,y[s++]=(f&15)<<4|h>>2,y[s++]=(h&3)<<6|p&63;return m},JS=typeof ArrayBuffer=="function",jh=(t,r)=>{if(typeof t!="string")return{type:"message",data:Ev(t,r)};const o=t.charAt(0);return o==="b"?{type:"message",data:WS(t.substring(1),r)}:du[o]?t.length>1?{type:du[o],data:t.substring(1)}:{type:du[o]}:sh},WS=(t,r)=>{if(JS){const o=KS(t);return Ev(o,r)}else return{base64:!0,data:t}},Ev=(t,r)=>r==="blob"?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer,Sv="",ew=(t,r)=>{const o=t.length,a=new Array(o);let s=0;t.forEach((u,f)=>{Lh(u,!1,h=>{a[f]=h,++s===o&&r(a.join(Sv))})})},tw=(t,r)=>{const o=t.split(Sv),a=[];for(let s=0;s<o.length;s++){const u=jh(o[s],r);if(a.push(u),u.type==="error")break}return a};function nw(){return new TransformStream({transform(t,r){QS(t,o=>{const a=o.length;let s;if(a<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,a);else if(a<65536){s=new Uint8Array(3);const u=new DataView(s.buffer);u.setUint8(0,126),u.setUint16(1,a)}else{s=new Uint8Array(9);const u=new DataView(s.buffer);u.setUint8(0,127),u.setBigUint64(1,BigInt(a))}t.data&&typeof t.data!="string"&&(s[0]|=128),r.enqueue(s),r.enqueue(o)})}})}let jd;function $s(t){return t.reduce((r,o)=>r+o.length,0)}function Zs(t,r){if(t[0].length===r)return t.shift();const o=new Uint8Array(r);let a=0;for(let s=0;s<r;s++)o[s]=t[0][a++],a===t[0].length&&(t.shift(),a=0);return t.length&&a<t[0].length&&(t[0]=t[0].slice(a)),o}function rw(t,r){jd||(jd=new TextDecoder);const o=[];let a=0,s=-1,u=!1;return new TransformStream({transform(f,h){for(o.push(f);;){if(a===0){if($s(o)<1)break;const p=Zs(o,1);u=(p[0]&128)===128,s=p[0]&127,s<126?a=3:s===126?a=1:a=2}else if(a===1){if($s(o)<2)break;const p=Zs(o,2);s=new DataView(p.buffer,p.byteOffset,p.length).getUint16(0),a=3}else if(a===2){if($s(o)<8)break;const p=Zs(o,8),m=new DataView(p.buffer,p.byteOffset,p.length),y=m.getUint32(0);if(y>Math.pow(2,21)-1){h.enqueue(sh);break}s=y*Math.pow(2,32)+m.getUint32(4),a=3}else{if($s(o)<s)break;const p=Zs(o,s);h.enqueue(jh(u?p:jd.decode(p),r)),a=0}if(s===0||s>t){h.enqueue(sh);break}}}})}const wv=4;function mt(t){if(t)return ow(t)}function ow(t){for(var r in mt.prototype)t[r]=mt.prototype[r];return t}mt.prototype.on=mt.prototype.addEventListener=function(t,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(r),this};mt.prototype.once=function(t,r){function o(){this.off(t,o),r.apply(this,arguments)}return o.fn=r,this.on(t,o),this};mt.prototype.off=mt.prototype.removeListener=mt.prototype.removeAllListeners=mt.prototype.removeEventListener=function(t,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var o=this._callbacks["$"+t];if(!o)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var a,s=0;s<o.length;s++)if(a=o[s],a===r||a.fn===r){o.splice(s,1);break}return o.length===0&&delete this._callbacks["$"+t],this};mt.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),o=this._callbacks["$"+t],a=1;a<arguments.length;a++)r[a-1]=arguments[a];if(o){o=o.slice(0);for(var a=0,s=o.length;a<s;++a)o[a].apply(this,r)}return this};mt.prototype.emitReserved=mt.prototype.emit;mt.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};mt.prototype.hasListeners=function(t){return!!this.listeners(t).length};const Gu=typeof Promise=="function"&&typeof Promise.resolve=="function"?r=>Promise.resolve().then(r):(r,o)=>o(r,0),un=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),iw="arraybuffer";function Av(t,...r){return r.reduce((o,a)=>(t.hasOwnProperty(a)&&(o[a]=t[a]),o),{})}const aw=un.setTimeout,lw=un.clearTimeout;function qu(t,r){r.useNativeTimers?(t.setTimeoutFn=aw.bind(un),t.clearTimeoutFn=lw.bind(un)):(t.setTimeoutFn=un.setTimeout.bind(un),t.clearTimeoutFn=un.clearTimeout.bind(un))}const sw=1.33;function uw(t){return typeof t=="string"?cw(t):Math.ceil((t.byteLength||t.size)*sw)}function cw(t){let r=0,o=0;for(let a=0,s=t.length;a<s;a++)r=t.charCodeAt(a),r<128?o+=1:r<2048?o+=2:r<55296||r>=57344?o+=3:(a++,o+=4);return o}function Tv(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function fw(t){let r="";for(let o in t)t.hasOwnProperty(o)&&(r.length&&(r+="&"),r+=encodeURIComponent(o)+"="+encodeURIComponent(t[o]));return r}function dw(t){let r={},o=t.split("&");for(let a=0,s=o.length;a<s;a++){let u=o[a].split("=");r[decodeURIComponent(u[0])]=decodeURIComponent(u[1])}return r}class hw extends Error{constructor(r,o,a){super(r),this.description=o,this.context=a,this.type="TransportError"}}class Fh extends mt{constructor(r){super(),this.writable=!1,qu(this,r),this.opts=r,this.query=r.query,this.socket=r.socket,this.supportsBinary=!r.forceBase64}onError(r,o,a){return super.emitReserved("error",new hw(r,o,a)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(r){this.readyState==="open"&&this.write(r)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(r){const o=jh(r,this.socket.binaryType);this.onPacket(o)}onPacket(r){super.emitReserved("packet",r)}onClose(r){this.readyState="closed",super.emitReserved("close",r)}pause(r){}createUri(r,o={}){return r+"://"+this._hostname()+this._port()+this.opts.path+this._query(o)}_hostname(){const r=this.opts.hostname;return r.indexOf(":")===-1?r:"["+r+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(r){const o=fw(r);return o.length?"?"+o:""}}class mw extends Fh{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(r){this.readyState="pausing";const o=()=>{this.readyState="paused",r()};if(this._polling||!this.writable){let a=0;this._polling&&(a++,this.once("pollComplete",function(){--a||o()})),this.writable||(a++,this.once("drain",function(){--a||o()}))}else o()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){const o=a=>{if(this.readyState==="opening"&&a.type==="open"&&this.onOpen(),a.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(a)};tw(r,this.socket.binaryType).forEach(o),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const r=()=>{this.write([{type:"close"}])};this.readyState==="open"?r():this.once("open",r)}write(r){this.writable=!1,ew(r,o=>{this.doWrite(o,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const r=this.opts.secure?"https":"http",o=this.query||{};return this.opts.timestampRequests!==!1&&(o[this.opts.timestampParam]=Tv()),!this.supportsBinary&&!o.sid&&(o.b64=1),this.createUri(r,o)}}let Cv=!1;try{Cv=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const pw=Cv;function gw(){}class yw extends mw{constructor(r){if(super(r),typeof location<"u"){const o=location.protocol==="https:";let a=location.port;a||(a=o?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||a!==r.port}}doWrite(r,o){const a=this.request({method:"POST",data:r});a.on("success",o),a.on("error",(s,u)=>{this.onError("xhr post error",s,u)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(o,a)=>{this.onError("xhr poll error",o,a)}),this.pollXhr=r}}class On extends mt{constructor(r,o,a){super(),this.createRequest=r,qu(this,a),this._opts=a,this._method=a.method||"GET",this._uri=o,this._data=a.data!==void 0?a.data:null,this._create()}_create(){var r;const o=Av(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");o.xdomain=!!this._opts.xd;const a=this._xhr=this.createRequest(o);try{a.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){a.setDisableHeaderCheck&&a.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&a.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{a.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{a.setRequestHeader("Accept","*/*")}catch{}(r=this._opts.cookieJar)===null||r===void 0||r.addCookies(a),"withCredentials"in a&&(a.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(a.timeout=this._opts.requestTimeout),a.onreadystatechange=()=>{var s;a.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(a.getResponseHeader("set-cookie"))),a.readyState===4&&(a.status===200||a.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof a.status=="number"?a.status:0)},0))},a.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=On.requestsCount++,On.requests[this._index]=this)}_onError(r){this.emitReserved("error",r,this._xhr),this._cleanup(!0)}_cleanup(r){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=gw,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete On.requests[this._index],this._xhr=null}}_onLoad(){const r=this._xhr.responseText;r!==null&&(this.emitReserved("data",r),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}On.requestsCount=0;On.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Ly);else if(typeof addEventListener=="function"){const t="onpagehide"in un?"pagehide":"unload";addEventListener(t,Ly,!1)}}function Ly(){for(let t in On.requests)On.requests.hasOwnProperty(t)&&On.requests[t].abort()}const xw=(function(){const t=Nv({xdomain:!1});return t&&t.responseType!==null})();class vw extends yw{constructor(r){super(r);const o=r&&r.forceBase64;this.supportsBinary=xw&&!o}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new On(Nv,this.uri(),r)}}function Nv(t){const r=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||pw))return new XMLHttpRequest}catch{}if(!r)try{return new un[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Rv=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class bw extends Fh{get name(){return"websocket"}doOpen(){const r=this.uri(),o=this.opts.protocols,a=Rv?{}:Av(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(a.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(r,o,a)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=r=>this.onClose({description:"websocket connection closed",context:r}),this.ws.onmessage=r=>this.onData(r.data),this.ws.onerror=r=>this.onError("websocket error",r)}write(r){this.writable=!1;for(let o=0;o<r.length;o++){const a=r[o],s=o===r.length-1;Lh(a,this.supportsBinary,u=>{try{this.doWrite(a,u)}catch{}s&&Gu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const r=this.opts.secure?"wss":"ws",o=this.query||{};return this.opts.timestampRequests&&(o[this.opts.timestampParam]=Tv()),this.supportsBinary||(o.b64=1),this.createUri(r,o)}}const Fd=un.WebSocket||un.MozWebSocket;class _w extends bw{createSocket(r,o,a){return Rv?new Fd(r,o,a):o?new Fd(r,o):new Fd(r)}doWrite(r,o){this.ws.send(o)}}class Ew extends Fh{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(r){return this.emitReserved("error",r)}this._transport.closed.then(()=>{this.onClose()}).catch(r=>{this.onError("webtransport error",r)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(r=>{const o=rw(Number.MAX_SAFE_INTEGER,this.socket.binaryType),a=r.readable.pipeThrough(o).getReader(),s=nw();s.readable.pipeTo(r.writable),this._writer=s.writable.getWriter();const u=()=>{a.read().then(({done:h,value:p})=>{h||(this.onPacket(p),u())}).catch(h=>{})};u();const f={type:"open"};this.query.sid&&(f.data=`{"sid":"${this.query.sid}"}`),this._writer.write(f).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let o=0;o<r.length;o++){const a=r[o],s=o===r.length-1;this._writer.write(a).then(()=>{s&&Gu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const Sw={websocket:_w,webtransport:Ew,polling:vw},ww=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Aw=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function uh(t){if(t.length>8e3)throw"URI too long";const r=t,o=t.indexOf("["),a=t.indexOf("]");o!=-1&&a!=-1&&(t=t.substring(0,o)+t.substring(o,a).replace(/:/g,";")+t.substring(a,t.length));let s=ww.exec(t||""),u={},f=14;for(;f--;)u[Aw[f]]=s[f]||"";return o!=-1&&a!=-1&&(u.source=r,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=Tw(u,u.path),u.queryKey=Cw(u,u.query),u}function Tw(t,r){const o=/\/{2,9}/g,a=r.replace(o,"/").split("/");return(r.slice(0,1)=="/"||r.length===0)&&a.splice(0,1),r.slice(-1)=="/"&&a.splice(a.length-1,1),a}function Cw(t,r){const o={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,s,u){s&&(o[s]=u)}),o}const ch=typeof addEventListener=="function"&&typeof removeEventListener=="function",hu=[];ch&&addEventListener("offline",()=>{hu.forEach(t=>t())},!1);class Pr extends mt{constructor(r,o){if(super(),this.binaryType=iw,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,r&&typeof r=="object"&&(o=r,r=null),r){const a=uh(r);o.hostname=a.host,o.secure=a.protocol==="https"||a.protocol==="wss",o.port=a.port,a.query&&(o.query=a.query)}else o.host&&(o.hostname=uh(o.host).host);qu(this,o),this.secure=o.secure!=null?o.secure:typeof location<"u"&&location.protocol==="https:",o.hostname&&!o.port&&(o.port=this.secure?"443":"80"),this.hostname=o.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=o.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},o.transports.forEach(a=>{const s=a.prototype.name;this.transports.push(s),this._transportsByName[s]=a}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},o),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=dw(this.opts.query)),ch&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},hu.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const o=Object.assign({},this.opts.query);o.EIO=wv,o.transport=r,this.id&&(o.sid=this.id);const a=Object.assign({},this.opts,{query:o,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[r]);return new this._transportsByName[r](a)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const r=this.opts.rememberUpgrade&&Pr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const o=this.createTransport(r);o.open(),this.setTransport(o)}setTransport(r){this.transport&&this.transport.removeAllListeners(),this.transport=r,r.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",o=>this._onClose("transport close",o))}onOpen(){this.readyState="open",Pr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",r),this.emitReserved("heartbeat"),r.type){case"open":this.onHandshake(JSON.parse(r.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const o=new Error("server error");o.code=r.data,this._onError(o);break;case"message":this.emitReserved("data",r.data),this.emitReserved("message",r.data);break}}onHandshake(r){this.emitReserved("handshake",r),this.id=r.sid,this.transport.query.sid=r.sid,this._pingInterval=r.pingInterval,this._pingTimeout=r.pingTimeout,this._maxPayload=r.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const r=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+r,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},r),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const r=this._getWritablePackets();this.transport.send(r),this._prevBufferLen=r.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let o=1;for(let a=0;a<this.writeBuffer.length;a++){const s=this.writeBuffer[a].data;if(s&&(o+=uw(s)),a>0&&o>this._maxPayload)return this.writeBuffer.slice(0,a);o+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const r=Date.now()>this._pingTimeoutTime;return r&&(this._pingTimeoutTime=0,Gu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),r}write(r,o,a){return this._sendPacket("message",r,o,a),this}send(r,o,a){return this._sendPacket("message",r,o,a),this}_sendPacket(r,o,a,s){if(typeof o=="function"&&(s=o,o=void 0),typeof a=="function"&&(s=a,a=null),this.readyState==="closing"||this.readyState==="closed")return;a=a||{},a.compress=a.compress!==!1;const u={type:r,data:o,options:a};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),s&&this.once("flush",s),this.flush()}close(){const r=()=>{this._onClose("forced close"),this.transport.close()},o=()=>{this.off("upgrade",o),this.off("upgradeError",o),r()},a=()=>{this.once("upgrade",o),this.once("upgradeError",o)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?a():r()}):this.upgrading?a():r()),this}_onError(r){if(Pr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",r),this._onClose("transport error",r)}_onClose(r,o){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ch&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const a=hu.indexOf(this._offlineEventListener);a!==-1&&hu.splice(a,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,o),this.writeBuffer=[],this._prevBufferLen=0}}}Pr.protocol=wv;class Nw extends Pr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let r=0;r<this._upgrades.length;r++)this._probe(this._upgrades[r])}_probe(r){let o=this.createTransport(r),a=!1;Pr.priorWebsocketSuccess=!1;const s=()=>{a||(o.send([{type:"ping",data:"probe"}]),o.once("packet",g=>{if(!a)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",o),!o)return;Pr.priorWebsocketSuccess=o.name==="websocket",this.transport.pause(()=>{a||this.readyState!=="closed"&&(y(),this.setTransport(o),o.send([{type:"upgrade"}]),this.emitReserved("upgrade",o),o=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=o.name,this.emitReserved("upgradeError",x)}}))};function u(){a||(a=!0,y(),o.close(),o=null)}const f=g=>{const x=new Error("probe error: "+g);x.transport=o.name,u(),this.emitReserved("upgradeError",x)};function h(){f("transport closed")}function p(){f("socket closed")}function m(g){o&&g.name!==o.name&&u()}const y=()=>{o.removeListener("open",s),o.removeListener("error",f),o.removeListener("close",h),this.off("close",p),this.off("upgrading",m)};o.once("open",s),o.once("error",f),o.once("close",h),this.once("close",p),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{a||o.open()},200):o.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const o=[];for(let a=0;a<r.length;a++)~this.transports.indexOf(r[a])&&o.push(r[a]);return o}}let Rw=class extends Nw{constructor(r,o={}){const a=typeof r=="object"?r:o;(!a.transports||a.transports&&typeof a.transports[0]=="string")&&(a.transports=(a.transports||["polling","websocket","webtransport"]).map(s=>Sw[s]).filter(s=>!!s)),super(r,a)}};function Mw(t,r="",o){let a=t;o=o||typeof location<"u"&&location,t==null&&(t=o.protocol+"//"+o.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=o.protocol+t:t=o.host+t),/^(https?|wss?):\/\//.test(t)||(typeof o<"u"?t=o.protocol+"//"+t:t="https://"+t),a=uh(t)),a.port||(/^(http|ws)$/.test(a.protocol)?a.port="80":/^(http|ws)s$/.test(a.protocol)&&(a.port="443")),a.path=a.path||"/";const u=a.host.indexOf(":")!==-1?"["+a.host+"]":a.host;return a.id=a.protocol+"://"+u+":"+a.port+r,a.href=a.protocol+"://"+u+(o&&o.port===a.port?"":":"+a.port),a}const Dw=typeof ArrayBuffer=="function",Ow=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Mv=Object.prototype.toString,zw=typeof Blob=="function"||typeof Blob<"u"&&Mv.call(Blob)==="[object BlobConstructor]",Bw=typeof File=="function"||typeof File<"u"&&Mv.call(File)==="[object FileConstructor]";function kh(t){return Dw&&(t instanceof ArrayBuffer||Ow(t))||zw&&t instanceof Blob||Bw&&t instanceof File}function mu(t,r){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let o=0,a=t.length;o<a;o++)if(mu(t[o]))return!0;return!1}if(kh(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return mu(t.toJSON(),!0);for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&mu(t[o]))return!0;return!1}function Uw(t){const r=[],o=t.data,a=t;return a.data=fh(o,r),a.attachments=r.length,{packet:a,buffers:r}}function fh(t,r){if(!t)return t;if(kh(t)){const o={_placeholder:!0,num:r.length};return r.push(t),o}else if(Array.isArray(t)){const o=new Array(t.length);for(let a=0;a<t.length;a++)o[a]=fh(t[a],r);return o}else if(typeof t=="object"&&!(t instanceof Date)){const o={};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(o[a]=fh(t[a],r));return o}return t}function Hw(t,r){return t.data=dh(t.data,r),delete t.attachments,t}function dh(t,r){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<r.length)return r[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o]=dh(t[o],r);else if(typeof t=="object")for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(t[o]=dh(t[o],r));return t}const Lw=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ue;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(Ue||(Ue={}));class jw{constructor(r){this.replacer=r}encode(r){return(r.type===Ue.EVENT||r.type===Ue.ACK)&&mu(r)?this.encodeAsBinary({type:r.type===Ue.EVENT?Ue.BINARY_EVENT:Ue.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let o=""+r.type;return(r.type===Ue.BINARY_EVENT||r.type===Ue.BINARY_ACK)&&(o+=r.attachments+"-"),r.nsp&&r.nsp!=="/"&&(o+=r.nsp+","),r.id!=null&&(o+=r.id),r.data!=null&&(o+=JSON.stringify(r.data,this.replacer)),o}encodeAsBinary(r){const o=Uw(r),a=this.encodeAsString(o.packet),s=o.buffers;return s.unshift(a),s}}class Vh extends mt{constructor(r){super(),this.reviver=r}add(r){let o;if(typeof r=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");o=this.decodeString(r);const a=o.type===Ue.BINARY_EVENT;a||o.type===Ue.BINARY_ACK?(o.type=a?Ue.EVENT:Ue.ACK,this.reconstructor=new Fw(o),o.attachments===0&&super.emitReserved("decoded",o)):super.emitReserved("decoded",o)}else if(kh(r)||r.base64)if(this.reconstructor)o=this.reconstructor.takeBinaryData(r),o&&(this.reconstructor=null,super.emitReserved("decoded",o));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+r)}decodeString(r){let o=0;const a={type:Number(r.charAt(0))};if(Ue[a.type]===void 0)throw new Error("unknown packet type "+a.type);if(a.type===Ue.BINARY_EVENT||a.type===Ue.BINARY_ACK){const u=o+1;for(;r.charAt(++o)!=="-"&&o!=r.length;);const f=r.substring(u,o);if(f!=Number(f)||r.charAt(o)!=="-")throw new Error("Illegal attachments");a.attachments=Number(f)}if(r.charAt(o+1)==="/"){const u=o+1;for(;++o&&!(r.charAt(o)===","||o===r.length););a.nsp=r.substring(u,o)}else a.nsp="/";const s=r.charAt(o+1);if(s!==""&&Number(s)==s){const u=o+1;for(;++o;){const f=r.charAt(o);if(f==null||Number(f)!=f){--o;break}if(o===r.length)break}a.id=Number(r.substring(u,o+1))}if(r.charAt(++o)){const u=this.tryParse(r.substr(o));if(Vh.isPayloadValid(a.type,u))a.data=u;else throw new Error("invalid payload")}return a}tryParse(r){try{return JSON.parse(r,this.reviver)}catch{return!1}}static isPayloadValid(r,o){switch(r){case Ue.CONNECT:return jy(o);case Ue.DISCONNECT:return o===void 0;case Ue.CONNECT_ERROR:return typeof o=="string"||jy(o);case Ue.EVENT:case Ue.BINARY_EVENT:return Array.isArray(o)&&(typeof o[0]=="number"||typeof o[0]=="string"&&Lw.indexOf(o[0])===-1);case Ue.ACK:case Ue.BINARY_ACK:return Array.isArray(o)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Fw{constructor(r){this.packet=r,this.buffers=[],this.reconPack=r}takeBinaryData(r){if(this.buffers.push(r),this.buffers.length===this.reconPack.attachments){const o=Hw(this.reconPack,this.buffers);return this.finishedReconstruction(),o}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function jy(t){return Object.prototype.toString.call(t)==="[object Object]"}const kw=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Vh,Encoder:jw,get PacketType(){return Ue}},Symbol.toStringTag,{value:"Module"}));function gn(t,r,o){return t.on(r,o),function(){t.off(r,o)}}const Vw=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Dv extends mt{constructor(r,o,a){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=r,this.nsp=o,a&&a.auth&&(this.auth=a.auth),this._opts=Object.assign({},a),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const r=this.io;this.subs=[gn(r,"open",this.onopen.bind(this)),gn(r,"packet",this.onpacket.bind(this)),gn(r,"error",this.onerror.bind(this)),gn(r,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...r){return r.unshift("message"),this.emit.apply(this,r),this}emit(r,...o){var a,s,u;if(Vw.hasOwnProperty(r))throw new Error('"'+r.toString()+'" is a reserved event name');if(o.unshift(r),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(o),this;const f={type:Ue.EVENT,data:o};if(f.options={},f.options.compress=this.flags.compress!==!1,typeof o[o.length-1]=="function"){const y=this.ids++,g=o.pop();this._registerAckCallback(y,g),f.id=y}const h=(s=(a=this.io.engine)===null||a===void 0?void 0:a.transport)===null||s===void 0?void 0:s.writable,p=this.connected&&!(!((u=this.io.engine)===null||u===void 0)&&u._hasPingExpired());return this.flags.volatile&&!h||(p?(this.notifyOutgoingListeners(f),this.packet(f)):this.sendBuffer.push(f)),this.flags={},this}_registerAckCallback(r,o){var a;const s=(a=this.flags.timeout)!==null&&a!==void 0?a:this._opts.ackTimeout;if(s===void 0){this.acks[r]=o;return}const u=this.io.setTimeoutFn(()=>{delete this.acks[r];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===r&&this.sendBuffer.splice(h,1);o.call(this,new Error("operation has timed out"))},s),f=(...h)=>{this.io.clearTimeoutFn(u),o.apply(this,h)};f.withError=!0,this.acks[r]=f}emitWithAck(r,...o){return new Promise((a,s)=>{const u=(f,h)=>f?s(f):a(h);u.withError=!0,o.push(u),this.emit(r,...o)})}_addToQueue(r){let o;typeof r[r.length-1]=="function"&&(o=r.pop());const a={id:this._queueSeq++,tryCount:0,pending:!1,args:r,flags:Object.assign({fromQueue:!0},this.flags)};r.push((s,...u)=>(this._queue[0],s!==null?a.tryCount>this._opts.retries&&(this._queue.shift(),o&&o(s)):(this._queue.shift(),o&&o(null,...u)),a.pending=!1,this._drainQueue())),this._queue.push(a),this._drainQueue()}_drainQueue(r=!1){if(!this.connected||this._queue.length===0)return;const o=this._queue[0];o.pending&&!r||(o.pending=!0,o.tryCount++,this.flags=o.flags,this.emit.apply(this,o.args))}packet(r){r.nsp=this.nsp,this.io._packet(r)}onopen(){typeof this.auth=="function"?this.auth(r=>{this._sendConnectPacket(r)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(r){this.packet({type:Ue.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},r):r})}onerror(r){this.connected||this.emitReserved("connect_error",r)}onclose(r,o){this.connected=!1,delete this.id,this.emitReserved("disconnect",r,o),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(r=>{if(!this.sendBuffer.some(a=>String(a.id)===r)){const a=this.acks[r];delete this.acks[r],a.withError&&a.call(this,new Error("socket has been disconnected"))}})}onpacket(r){if(r.nsp===this.nsp)switch(r.type){case Ue.CONNECT:r.data&&r.data.sid?this.onconnect(r.data.sid,r.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ue.EVENT:case Ue.BINARY_EVENT:this.onevent(r);break;case Ue.ACK:case Ue.BINARY_ACK:this.onack(r);break;case Ue.DISCONNECT:this.ondisconnect();break;case Ue.CONNECT_ERROR:this.destroy();const a=new Error(r.data.message);a.data=r.data.data,this.emitReserved("connect_error",a);break}}onevent(r){const o=r.data||[];r.id!=null&&o.push(this.ack(r.id)),this.connected?this.emitEvent(o):this.receiveBuffer.push(Object.freeze(o))}emitEvent(r){if(this._anyListeners&&this._anyListeners.length){const o=this._anyListeners.slice();for(const a of o)a.apply(this,r)}super.emit.apply(this,r),this._pid&&r.length&&typeof r[r.length-1]=="string"&&(this._lastOffset=r[r.length-1])}ack(r){const o=this;let a=!1;return function(...s){a||(a=!0,o.packet({type:Ue.ACK,id:r,data:s}))}}onack(r){const o=this.acks[r.id];typeof o=="function"&&(delete this.acks[r.id],o.withError&&r.data.unshift(null),o.apply(this,r.data))}onconnect(r,o){this.id=r,this.recovered=o&&this._pid===o,this._pid=o,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(r=>this.emitEvent(r)),this.receiveBuffer=[],this.sendBuffer.forEach(r=>{this.notifyOutgoingListeners(r),this.packet(r)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(r=>r()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ue.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(r){return this.flags.compress=r,this}get volatile(){return this.flags.volatile=!0,this}timeout(r){return this.flags.timeout=r,this}onAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(r),this}prependAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(r),this}offAny(r){if(!this._anyListeners)return this;if(r){const o=this._anyListeners;for(let a=0;a<o.length;a++)if(r===o[a])return o.splice(a,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(r),this}prependAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(r),this}offAnyOutgoing(r){if(!this._anyOutgoingListeners)return this;if(r){const o=this._anyOutgoingListeners;for(let a=0;a<o.length;a++)if(r===o[a])return o.splice(a,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(r){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const o=this._anyOutgoingListeners.slice();for(const a of o)a.apply(this,r.data)}}}function qi(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}qi.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),o=Math.floor(r*this.jitter*t);t=(Math.floor(r*10)&1)==0?t-o:t+o}return Math.min(t,this.max)|0};qi.prototype.reset=function(){this.attempts=0};qi.prototype.setMin=function(t){this.ms=t};qi.prototype.setMax=function(t){this.max=t};qi.prototype.setJitter=function(t){this.jitter=t};class hh extends mt{constructor(r,o){var a;super(),this.nsps={},this.subs=[],r&&typeof r=="object"&&(o=r,r=void 0),o=o||{},o.path=o.path||"/socket.io",this.opts=o,qu(this,o),this.reconnection(o.reconnection!==!1),this.reconnectionAttempts(o.reconnectionAttempts||1/0),this.reconnectionDelay(o.reconnectionDelay||1e3),this.reconnectionDelayMax(o.reconnectionDelayMax||5e3),this.randomizationFactor((a=o.randomizationFactor)!==null&&a!==void 0?a:.5),this.backoff=new qi({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(o.timeout==null?2e4:o.timeout),this._readyState="closed",this.uri=r;const s=o.parser||kw;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=o.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(r){return arguments.length?(this._reconnection=!!r,r||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(r){return r===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=r,this)}reconnectionDelay(r){var o;return r===void 0?this._reconnectionDelay:(this._reconnectionDelay=r,(o=this.backoff)===null||o===void 0||o.setMin(r),this)}randomizationFactor(r){var o;return r===void 0?this._randomizationFactor:(this._randomizationFactor=r,(o=this.backoff)===null||o===void 0||o.setJitter(r),this)}reconnectionDelayMax(r){var o;return r===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=r,(o=this.backoff)===null||o===void 0||o.setMax(r),this)}timeout(r){return arguments.length?(this._timeout=r,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(r){if(~this._readyState.indexOf("open"))return this;this.engine=new Rw(this.uri,this.opts);const o=this.engine,a=this;this._readyState="opening",this.skipReconnect=!1;const s=gn(o,"open",function(){a.onopen(),r&&r()}),u=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),r?r(h):this.maybeReconnectOnOpen()},f=gn(o,"error",u);if(this._timeout!==!1){const h=this._timeout,p=this.setTimeoutFn(()=>{s(),u(new Error("timeout")),o.close()},h);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(s),this.subs.push(f),this}connect(r){return this.open(r)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const r=this.engine;this.subs.push(gn(r,"ping",this.onping.bind(this)),gn(r,"data",this.ondata.bind(this)),gn(r,"error",this.onerror.bind(this)),gn(r,"close",this.onclose.bind(this)),gn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(r){try{this.decoder.add(r)}catch(o){this.onclose("parse error",o)}}ondecoded(r){Gu(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,o){let a=this.nsps[r];return a?this._autoConnect&&!a.active&&a.connect():(a=new Dv(this,r,o),this.nsps[r]=a),a}_destroy(r){const o=Object.keys(this.nsps);for(const a of o)if(this.nsps[a].active)return;this._close()}_packet(r){const o=this.encoder.encode(r);for(let a=0;a<o.length;a++)this.engine.write(o[a],r.options)}cleanup(){this.subs.forEach(r=>r()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(r,o){var a;this.cleanup(),(a=this.engine)===null||a===void 0||a.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",r,o),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const r=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const o=this.backoff.duration();this._reconnecting=!0;const a=this.setTimeoutFn(()=>{r.skipReconnect||(this.emitReserved("reconnect_attempt",r.backoff.attempts),!r.skipReconnect&&r.open(s=>{s?(r._reconnecting=!1,r.reconnect(),this.emitReserved("reconnect_error",s)):r.onreconnect()}))},o);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}}onreconnect(){const r=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",r)}}const Ga={};function pu(t,r){typeof t=="object"&&(r=t,t=void 0),r=r||{};const o=Mw(t,r.path||"/socket.io"),a=o.source,s=o.id,u=o.path,f=Ga[s]&&u in Ga[s].nsps,h=r.forceNew||r["force new connection"]||r.multiplex===!1||f;let p;return h?p=new hh(a,r):(Ga[s]||(Ga[s]=new hh(a,r)),p=Ga[s]),o.query&&!r.query&&(r.query=o.queryKey),p.socket(o.path,r)}Object.assign(pu,{Manager:hh,Socket:Dv,io:pu,connect:pu});const Gw=`#version 300 es
|
|
10
|
+
precision mediump float;
|
|
11
|
+
|
|
12
|
+
uniform sampler2D u_texture; // input
|
|
13
|
+
uniform vec3 u_sourceColor; // color
|
|
14
|
+
uniform vec4 u_targetColor; // color [0, 0, 0, 0]
|
|
15
|
+
uniform float u_threshold; // [0, 1, 0.1]
|
|
16
|
+
|
|
17
|
+
in vec2 vUv;
|
|
18
|
+
out vec4 fragColor;
|
|
19
|
+
|
|
20
|
+
void main() {
|
|
21
|
+
vec4 texColor = texture(u_texture, vUv);
|
|
22
|
+
|
|
23
|
+
float colorDiff = distance(texColor.rgb, u_sourceColor) / 2.0;
|
|
24
|
+
|
|
25
|
+
if (colorDiff < u_threshold) {
|
|
26
|
+
fragColor = u_targetColor;
|
|
27
|
+
} else {
|
|
28
|
+
fragColor = texColor;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`,qw=`#version 300 es
|
|
32
|
+
|
|
33
|
+
precision highp float;
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
uniform float u_time; // time
|
|
37
|
+
uniform vec2 u_resolution; // resolution
|
|
38
|
+
uniform vec3 u_notes;
|
|
39
|
+
uniform vec2 u_mouse; //mouse
|
|
40
|
+
|
|
41
|
+
uniform float u_flower_count; // [1, 10, 5]
|
|
42
|
+
uniform float u_flower_rotation; // [-6, 10, 5]
|
|
43
|
+
|
|
44
|
+
uniform float u_ring_radius; // [-1, 10, 2]
|
|
45
|
+
uniform float u_rotation_offset; // [1, 10, 5]
|
|
46
|
+
uniform float u_mouse_rotation; // [0, 2, 0.1]
|
|
47
|
+
uniform float u_mouse_scale_factor; // [0, 1, 0.1]
|
|
48
|
+
uniform vec3 u_origin; // [0, 0.5, -20]
|
|
49
|
+
|
|
50
|
+
in vec2 vUv;
|
|
51
|
+
out vec4 fragColor;
|
|
52
|
+
|
|
53
|
+
float sdSphere(vec3 p, float r)
|
|
54
|
+
{
|
|
55
|
+
return length(p) - r;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
float sdCappedCylinder(vec3 p, float h, float r)
|
|
59
|
+
{
|
|
60
|
+
vec2 d = abs(vec2(length(p.xz), p.y)) - vec2(r, h);
|
|
61
|
+
return min(max(d.x,d.y),0.0) + length(max(d,0.0));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
float sdCappedCone( vec3 p, float h, float r1, float r2 )
|
|
65
|
+
{
|
|
66
|
+
vec2 q = vec2( length(p.xz), p.y );
|
|
67
|
+
vec2 k1 = vec2(r2,h);
|
|
68
|
+
vec2 k2 = vec2(r2-r1,2.0*h);
|
|
69
|
+
vec2 ca = vec2(q.x-min(q.x,(q.y<0.0)?r1:r2), abs(q.y)-h);
|
|
70
|
+
vec2 cb = q - k1 + k2*clamp( dot(k1-q,k2)/dot(k2, k2), 0.0, 1.0 );
|
|
71
|
+
float s = (cb.x<0.0 && ca.y<0.0) ? -1.0 : 1.0;
|
|
72
|
+
return s*sqrt( min(dot(ca, ca),dot(cb, cb)) );
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
float sdEllipsoid(vec3 p, vec3 r)
|
|
76
|
+
{
|
|
77
|
+
return (length(p/r) - 1.0) * min(min(r.x,r.y),r.z);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
float smin(float a, float b, float k)
|
|
81
|
+
{
|
|
82
|
+
if (k <= 0.00001) return min(a, b);
|
|
83
|
+
float h = clamp(0.5 + 0.5*(b-a)/k, 0.0, 1.0);
|
|
84
|
+
return mix(b, a, h) - k*h*(1.0-h);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
float gain( float x, float k )
|
|
89
|
+
{
|
|
90
|
+
float a = 0.5*pow(2.0*((x<0.5)?x:1.0-x), k);
|
|
91
|
+
return (x<0.5)?a:1.0-a;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
vec3 rotateAroundAxis(vec3 v, vec3 axis, float angle) {
|
|
95
|
+
axis = normalize(axis);
|
|
96
|
+
float s = sin(angle);
|
|
97
|
+
float c = cos(angle);
|
|
98
|
+
float oc = 1.0 - c;
|
|
99
|
+
|
|
100
|
+
return v * c +
|
|
101
|
+
cross(axis, v) * s +
|
|
102
|
+
axis * dot(axis, v) * oc;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
float petals(vec3 p)
|
|
106
|
+
{
|
|
107
|
+
float petals = 1000.0;
|
|
108
|
+
const int PETAL_COUNT = 6;
|
|
109
|
+
for(int i = 0; i < PETAL_COUNT; i++)
|
|
110
|
+
{
|
|
111
|
+
float angle = float(i) / float(PETAL_COUNT) * 6.28318;
|
|
112
|
+
vec3 rp = p;
|
|
113
|
+
|
|
114
|
+
float c = cos(angle);
|
|
115
|
+
float s = sin(angle);
|
|
116
|
+
rp.xz = mat2(c, -s, s, c) * rp.xz;
|
|
117
|
+
|
|
118
|
+
float dist_from_center = length(rp.xz) * 7.0;
|
|
119
|
+
|
|
120
|
+
// adds dip near stem
|
|
121
|
+
rp.y -= 2.0 / pow(1.3 - (1.0-u_mouse.y * u_mouse_scale_factor) / 10.0, dist_from_center + abs(rp.x) * 5.0);
|
|
122
|
+
|
|
123
|
+
// adds tilt between leaves
|
|
124
|
+
rp.y += smoothstep(-0.9, 0.9, rp.x / 4.0) + 1.0;
|
|
125
|
+
|
|
126
|
+
// pushes petal tip out
|
|
127
|
+
rp.z += 1.0/(abs(rp.x) + 1.5) + 0.5 + (1.0-u_mouse.y * u_mouse_scale_factor) / 2.0;
|
|
128
|
+
|
|
129
|
+
float petal = sdEllipsoid(rp, vec3(0.1 + (1.0-u_mouse.y * u_mouse_scale_factor) / 10.0, 0.02, 0.2 + (1.0-u_mouse.y * u_mouse_scale_factor) / 10.0));
|
|
130
|
+
petals = smin(petals, petal, 0.1);
|
|
131
|
+
}
|
|
132
|
+
return petals;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
float trumpet(vec3 p)
|
|
136
|
+
{
|
|
137
|
+
float dist_from_center = length(p.xz);
|
|
138
|
+
vec3 p_base = p;
|
|
139
|
+
p_base.y +=1.0;
|
|
140
|
+
float trumpetbase = sdCappedCone(p_base, 0.6 + (1.0-u_mouse.y * u_mouse_scale_factor), 0.3, 0.1);
|
|
141
|
+
|
|
142
|
+
vec3 p_flare = p;
|
|
143
|
+
p_flare.y -= 1.0 / (dist_from_center + 0.4) - 3.2 - (1.0-u_mouse.y * u_mouse_scale_factor);
|
|
144
|
+
|
|
145
|
+
float r = length(p_flare.xz);
|
|
146
|
+
float angle = atan(p_flare.z, p_flare.x);
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
float hyper = 1.0 / (r + 10.0);
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
p_flare.y += hyper * sin(angle * (angle - 1.6) * 2.0);
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
float flare = sdEllipsoid(p_flare, vec3(0.09 + (1.0-u_mouse.y * u_mouse_scale_factor) / 20.0, 0.01, 0.09 + (1.0-u_mouse.y * u_mouse_scale_factor) / 20.0));
|
|
156
|
+
float trumpet = smin(trumpetbase, flare, 0.6 + (1.0-u_mouse.y * u_mouse_scale_factor) / 2.0);
|
|
157
|
+
|
|
158
|
+
return trumpet;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
float leaves(vec3 p) {
|
|
162
|
+
float leaves = 1000.0;
|
|
163
|
+
const int LEAF_COUNT = 5;
|
|
164
|
+
for(int i = 0; i < LEAF_COUNT; i++)
|
|
165
|
+
{
|
|
166
|
+
float angle = float(i) / float(LEAF_COUNT) * 6.28318;
|
|
167
|
+
vec3 rp = p;
|
|
168
|
+
|
|
169
|
+
float c = cos(angle);
|
|
170
|
+
float s = sin(angle);
|
|
171
|
+
rp.xz = mat2(c, -s, s, c) * rp.xz;
|
|
172
|
+
|
|
173
|
+
float dist_from_center = length(rp.xz);
|
|
174
|
+
|
|
175
|
+
rp.y += smoothstep(0.0,4.0, dist_from_center) * 20.0 - 15.0;
|
|
176
|
+
rp.z += angle / 4.0;
|
|
177
|
+
|
|
178
|
+
float leaf = sdEllipsoid(rp, vec3(0.5, 2.0, 0.5 + (1.0-u_mouse.y * u_mouse_scale_factor) / 2.0));
|
|
179
|
+
leaves = smin(leaves, leaf, (1.0-u_mouse.y * u_mouse_scale_factor));
|
|
180
|
+
}
|
|
181
|
+
return leaves;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
float single_flower(vec3 p)
|
|
185
|
+
{
|
|
186
|
+
float scaledTime = u_time / 2.0;
|
|
187
|
+
|
|
188
|
+
float bendStart = 7.0;
|
|
189
|
+
float bendEnd = 0.0;
|
|
190
|
+
|
|
191
|
+
float h = clamp((p.y - bendStart) / (bendEnd - bendStart), 0.0, 1.0);
|
|
192
|
+
|
|
193
|
+
h = h * h;
|
|
194
|
+
|
|
195
|
+
float maxBend = sin(u_time / 2.0) / 10.0 + 0.6 - (gain(u_notes.x - u_notes.z / 2.0, 2.0)-0.5) / 5.0;
|
|
196
|
+
|
|
197
|
+
float bendAngle = h * maxBend;
|
|
198
|
+
|
|
199
|
+
//p = rotateAroundAxis(p, vec3(1.0, 0.0, 0.0), 0.2);
|
|
200
|
+
p = rotateAroundAxis(p, vec3(0.0, 1.0, 0.0), u_flower_rotation);
|
|
201
|
+
|
|
202
|
+
p = rotateAroundAxis(p, vec3(1.0, 0.0, 0.0), -bendAngle);
|
|
203
|
+
|
|
204
|
+
//p.xz += vec2(sin(p.y * 0.2+ scaledTime), cos(p.y * 0.20 + scaledTime)) * smoothstep(-1.0, 0.0, p.y) / 2.0;
|
|
205
|
+
|
|
206
|
+
vec3 stemP = p;
|
|
207
|
+
stemP.y -= 6.0;
|
|
208
|
+
float stem = sdCappedCylinder(stemP, 7.0, 0.01);
|
|
209
|
+
|
|
210
|
+
float flower = smin(smin(petals(p), trumpet(p), 0.0), leaves(p), 0.0);
|
|
211
|
+
|
|
212
|
+
float scene = smin(flower, stem, 1.0);
|
|
213
|
+
|
|
214
|
+
return scene;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
float sceneSDF(vec3 p)
|
|
218
|
+
{
|
|
219
|
+
float radius = u_ring_radius + (1.0-u_mouse.y * u_mouse_scale_factor) * 3.0;
|
|
220
|
+
|
|
221
|
+
p = rotateAroundAxis(p, vec3(1.0, 0.0, 0.0), -0.5);
|
|
222
|
+
float angle = atan(p.z, p.x) +.4 + (sin(u_time / 4.0) ) / 10.0 - (gain(u_mouse.x, 1.2) - 0.5) * u_mouse_rotation + u_rotation_offset;
|
|
223
|
+
float r = length(p.xz);
|
|
224
|
+
|
|
225
|
+
float sectorAngle = 6.28318 / u_flower_count;
|
|
226
|
+
|
|
227
|
+
float id = floor((angle + 3.14159) / sectorAngle);
|
|
228
|
+
|
|
229
|
+
float centerAngle = id * sectorAngle + sectorAngle * 0.5 - 3.14159;
|
|
230
|
+
|
|
231
|
+
float localAngle = angle - centerAngle;
|
|
232
|
+
|
|
233
|
+
vec3 localP;
|
|
234
|
+
|
|
235
|
+
localP.x = r * cos(localAngle) - radius;
|
|
236
|
+
localP.z = r * sin(localAngle);
|
|
237
|
+
localP.y = p.y;
|
|
238
|
+
|
|
239
|
+
float variation = sin(id * 12.37);
|
|
240
|
+
|
|
241
|
+
localP = rotateAroundAxis(localP, vec3(0.0,1.0,0.0), centerAngle);
|
|
242
|
+
|
|
243
|
+
localP.y += sin(id * 5.17) * 0.35;
|
|
244
|
+
|
|
245
|
+
return single_flower(localP);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
void main()
|
|
251
|
+
{
|
|
252
|
+
vec2 uv = vec2(vUv.x * 2.0 - 1.0, (1.0 -vUv.y) * 2.0 - 1.0);
|
|
253
|
+
float aspect = u_resolution.x / u_resolution.y;
|
|
254
|
+
vec2 resolution = vec2(uv.x * aspect, uv.y) * 0.5;
|
|
255
|
+
|
|
256
|
+
vec3 ray_origin = vec3(0, (1.0-u_mouse.y * u_mouse_scale_factor) * 1.0, (1.0-u_mouse.y * u_mouse_scale_factor) * 7.0) + u_origin;
|
|
257
|
+
vec3 ray_direction = normalize(vec3(resolution, 1.0));
|
|
258
|
+
|
|
259
|
+
float MAX_DIST = 20.0 + 10.0 * (1.0-u_mouse.y * u_mouse_scale_factor);
|
|
260
|
+
const int MAX_STEPS = 100;
|
|
261
|
+
float dist_traveled = 0.0;
|
|
262
|
+
int steps = 0;
|
|
263
|
+
int intersected = 0;
|
|
264
|
+
float min_dist = 100.0;
|
|
265
|
+
|
|
266
|
+
for(int i = 0; i < MAX_STEPS; i++)
|
|
267
|
+
{
|
|
268
|
+
vec3 current_pos = ray_origin + ray_direction * dist_traveled;
|
|
269
|
+
|
|
270
|
+
float distance = sceneSDF(current_pos);
|
|
271
|
+
|
|
272
|
+
min_dist = min(distance, min_dist);
|
|
273
|
+
|
|
274
|
+
if(distance < 0.1)
|
|
275
|
+
{
|
|
276
|
+
intersected = 1;
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if(dist_traveled > MAX_DIST)
|
|
281
|
+
break;
|
|
282
|
+
|
|
283
|
+
dist_traveled += distance * 0.5;
|
|
284
|
+
steps += 1;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
fragColor = vec4(
|
|
288
|
+
mix(
|
|
289
|
+
vec3(
|
|
290
|
+
//0.0,
|
|
291
|
+
//pow(max(0.0,1.0 - float(min_dist)), 2.0 * u_notes.x + 1.0),
|
|
292
|
+
pow(max(0.0,1.0 - float(min_dist)), 0.5 * u_notes.x + 1.0) * 1.2
|
|
293
|
+
//pow(1.0 - float(steps) / float(MAX_STEPS), 2.0),
|
|
294
|
+
//1.0
|
|
295
|
+
),
|
|
296
|
+
vec3(
|
|
297
|
+
pow(max(0.0,1.0 - dist_traveled / MAX_DIST), 1.0)
|
|
298
|
+
//pow(1.0 - float(steps) / float(MAX_STEPS), 2.0)
|
|
299
|
+
//1.0
|
|
300
|
+
),
|
|
301
|
+
pow(min(1.0,(1.0 - u_notes.x - u_notes.z + u_notes.y) + 0.4), 2.0)
|
|
302
|
+
//float(intersected)
|
|
303
|
+
),
|
|
304
|
+
1.0
|
|
305
|
+
);
|
|
306
|
+
}`,Xw=`#version 300 es
|
|
307
|
+
precision mediump float;
|
|
308
|
+
|
|
309
|
+
uniform sampler2D u_texture;
|
|
310
|
+
uniform vec2 u_resolution; // resolution
|
|
311
|
+
uniform float u_numColors; // [2, 16, 2]
|
|
312
|
+
uniform float u_dither_size; // [1, 100, 10]
|
|
313
|
+
|
|
314
|
+
in vec2 vUv;
|
|
315
|
+
out vec4 fragColor;
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
int bayer(int x, int y) {
|
|
319
|
+
int bayer64[64] = int[64](
|
|
320
|
+
0, 32, 8, 40, 2, 34, 10, 42,
|
|
321
|
+
48, 16, 56, 24, 50, 18, 58, 26,
|
|
322
|
+
12, 44, 4, 36, 14, 46, 6, 38,
|
|
323
|
+
60, 28, 52, 20, 62, 30, 54, 22,
|
|
324
|
+
3, 35, 11, 43, 1, 33, 9, 41,
|
|
325
|
+
51, 19, 59, 27, 49, 17, 57, 25,
|
|
326
|
+
15, 47, 7, 39, 13, 45, 5, 37,
|
|
327
|
+
63, 31, 55, 23, 61, 29, 53, 21
|
|
328
|
+
);
|
|
329
|
+
return bayer64[(y % 8) * 8 + (x % 8)];
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
void main() {
|
|
333
|
+
vec2 cell = floor(vUv * u_resolution / u_dither_size);
|
|
334
|
+
vec2 cellUv = cell / u_resolution * u_dither_size;
|
|
335
|
+
|
|
336
|
+
vec4 color = texture(u_texture, cellUv);
|
|
337
|
+
|
|
338
|
+
float threshold = (float(bayer(int(cell.x), int(cell.y))) + 0.5) / 64.0 - 0.5;
|
|
339
|
+
|
|
340
|
+
float n = max(2.0, u_numColors);
|
|
341
|
+
float step = 1.0 / (n - 1.0);
|
|
342
|
+
vec3 dithered = clamp(round((color.rgb + threshold * step) / step) * step, 0.0, 1.0);
|
|
343
|
+
|
|
344
|
+
fragColor = vec4(dithered, color.a);
|
|
345
|
+
}
|
|
346
|
+
`,Yw=`#version 300 es
|
|
347
|
+
precision mediump float;
|
|
348
|
+
|
|
349
|
+
uniform sampler2D u_texture; // input
|
|
350
|
+
uniform float u_frequency; // [1, 100, 20]
|
|
351
|
+
uniform float u_radius; // [0, 1, 0.5]
|
|
352
|
+
uniform float u_rotation; // [0, 6.28, 0]
|
|
353
|
+
uniform float u_constantSize; // [0, 1, 0]
|
|
354
|
+
uniform vec4 u_background; // color [1, 1, 1, 1]
|
|
355
|
+
|
|
356
|
+
in vec2 vUv;
|
|
357
|
+
out vec4 fragColor;
|
|
358
|
+
|
|
359
|
+
vec2 rot(vec2 v, float a) {
|
|
360
|
+
float c = cos(a), s = sin(a);
|
|
361
|
+
return mat2(c, -s, s, c) * v;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
void main() {
|
|
365
|
+
// rotate UV space around center
|
|
366
|
+
vec2 rotUv = rot(vUv - 0.5, u_rotation) + 0.5;
|
|
367
|
+
|
|
368
|
+
// find nearest grid cell center in rotated space
|
|
369
|
+
vec2 cellUv = rotUv * u_frequency;
|
|
370
|
+
vec2 cellId = round(cellUv);
|
|
371
|
+
|
|
372
|
+
// unrotate cell center to sample from original texture
|
|
373
|
+
vec2 sampleUv = rot(cellId / u_frequency - 0.5, -u_rotation) + 0.5;
|
|
374
|
+
vec4 cellColor = texture(u_texture, clamp(sampleUv, 0.0, 1.0));
|
|
375
|
+
|
|
376
|
+
// luminance drives dot radius unless constant size is toggled
|
|
377
|
+
float lum = dot(cellColor.rgb, vec3(0.299, 0.587, 0.114));
|
|
378
|
+
float dotRadius = u_radius * mix(lum, 1.0, step(0.5, u_constantSize));
|
|
379
|
+
|
|
380
|
+
// distance from current pixel to nearest cell center (in cell-space units)
|
|
381
|
+
float dist = length(cellUv - cellId) / u_frequency * u_frequency;
|
|
382
|
+
|
|
383
|
+
fragColor = dist < dotRadius ? cellColor : u_background;
|
|
384
|
+
}
|
|
385
|
+
`,Iw=`#version 300 es
|
|
386
|
+
precision highp float;
|
|
387
|
+
|
|
388
|
+
in vec2 vUv;
|
|
389
|
+
out vec4 fragColor;
|
|
390
|
+
|
|
391
|
+
uniform vec2 u_resolution; // [100, 100]
|
|
392
|
+
uniform float u_time; // time
|
|
393
|
+
uniform float u_mod_size; // [0, 2, 1]
|
|
394
|
+
uniform float u_tile_factor; // [1, 100, 10]
|
|
395
|
+
uniform vec2 u_translation; // [0,0]
|
|
396
|
+
|
|
397
|
+
float modSigned(float x, float y) {
|
|
398
|
+
return x - y * sign(x) * floor(abs(x/y));
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
void main() {
|
|
402
|
+
// Map UV coordinates to RGB
|
|
403
|
+
float aspect = u_resolution.x / u_resolution.y;
|
|
404
|
+
vec2 uv = vec2(
|
|
405
|
+
(vUv.x + sin((u_translation.x +vUv.x) * 10.0) * sin(vUv.y + u_translation.y + u_time / 100.0) * .01 ) * aspect,
|
|
406
|
+
vUv.y + sin((u_translation.y+vUv.y) * 7.0) * 0.05 * sin(vUv.x + u_translation.x + u_time / 100.)) * u_tile_factor + u_translation;
|
|
407
|
+
|
|
408
|
+
vec2 localUv = vec2(
|
|
409
|
+
mod(uv.x, u_mod_size),
|
|
410
|
+
mod(uv.y,u_mod_size)
|
|
411
|
+
);
|
|
412
|
+
|
|
413
|
+
float dist = length(
|
|
414
|
+
localUv - (u_mod_size / 2.0)
|
|
415
|
+
);
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
fragColor = mix(
|
|
419
|
+
vec4(1.0 - localUv.x, localUv.y,1., 1.0),
|
|
420
|
+
vec4(vec3(1.0), 1.0),
|
|
421
|
+
smoothstep(0.6, 0.5, dist)
|
|
422
|
+
);
|
|
423
|
+
}`,Pw=`#version 300 es
|
|
424
|
+
precision mediump float;
|
|
425
|
+
|
|
426
|
+
uniform sampler2D u_texture;
|
|
427
|
+
uniform sampler2D u_gradientTexture; // gradient
|
|
428
|
+
in vec2 vUv;
|
|
429
|
+
out vec4 fragColor;
|
|
430
|
+
|
|
431
|
+
void main() {
|
|
432
|
+
vec4 color = texture(u_texture, vUv);
|
|
433
|
+
|
|
434
|
+
float brightness = dot(color.rgb, vec3(0.299, 0.587, 0.114));
|
|
435
|
+
|
|
436
|
+
vec4 gradientColor = texture(u_gradientTexture, vec2(brightness, 0.5));
|
|
437
|
+
|
|
438
|
+
fragColor = vec4(gradientColor.rgb, 1.0);
|
|
439
|
+
}
|
|
440
|
+
`,$w=`#version 300 es
|
|
441
|
+
precision mediump float;
|
|
442
|
+
|
|
443
|
+
uniform sampler2D u_texture; // input
|
|
444
|
+
uniform vec3 u_hslAdjust; // H (degrees), S (0-1), L (0-1) — [0, 0, 0]
|
|
445
|
+
|
|
446
|
+
in vec2 vUv;
|
|
447
|
+
out vec4 fragColor;
|
|
448
|
+
|
|
449
|
+
vec3 rgb2hsl(vec3 color) {
|
|
450
|
+
float maxC = max(max(color.r, color.g), color.b);
|
|
451
|
+
float minC = min(min(color.r, color.g), color.b);
|
|
452
|
+
float delta = maxC - minC;
|
|
453
|
+
|
|
454
|
+
float h = 0.0;
|
|
455
|
+
float s = 0.0;
|
|
456
|
+
float l = (maxC + minC) / 2.0;
|
|
457
|
+
|
|
458
|
+
if (delta != 0.0) {
|
|
459
|
+
s = l > 0.5 ? delta / (2.0 - maxC - minC) : delta / (maxC + minC);
|
|
460
|
+
|
|
461
|
+
if (color.r == maxC) {
|
|
462
|
+
h = (color.g - color.b) / delta + (color.g < color.b ? 6.0 : 0.0);
|
|
463
|
+
} else if (color.g == maxC) {
|
|
464
|
+
h = (color.b - color.r) / delta + 2.0;
|
|
465
|
+
} else {
|
|
466
|
+
h = (color.r - color.g) / delta + 4.0;
|
|
467
|
+
}
|
|
468
|
+
h /= 6.0;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
return vec3(h, s, l);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
float hue2rgb(float p, float q, float t) {
|
|
475
|
+
if (t < 0.0) t += 1.0;
|
|
476
|
+
if (t > 1.0) t -= 1.0;
|
|
477
|
+
if (t < 1.0/6.0) return p + (q - p) * 6.0 * t;
|
|
478
|
+
if (t < 1.0/2.0) return q;
|
|
479
|
+
if (t < 2.0/3.0) return p + (q - p) * (2.0/3.0 - t) * 6.0;
|
|
480
|
+
return p;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
vec3 hsl2rgb(vec3 hsl) {
|
|
484
|
+
float h = hsl.x;
|
|
485
|
+
float s = hsl.y;
|
|
486
|
+
float l = hsl.z;
|
|
487
|
+
|
|
488
|
+
if (s == 0.0) {
|
|
489
|
+
return vec3(l);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
float q = l < 0.5 ? l * (1.0 + s) : l + s - l * s;
|
|
493
|
+
float p = 2.0 * l - q;
|
|
494
|
+
return vec3(
|
|
495
|
+
hue2rgb(p, q, h + 1.0/3.0),
|
|
496
|
+
hue2rgb(p, q, h),
|
|
497
|
+
hue2rgb(p, q, h - 1.0/3.0)
|
|
498
|
+
);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
void main() {
|
|
502
|
+
vec4 color = texture(u_texture, vUv);
|
|
503
|
+
|
|
504
|
+
vec3 hsl = rgb2hsl(color.rgb);
|
|
505
|
+
|
|
506
|
+
hsl.x = mod(hsl.x + u_hslAdjust.x / 360.0, 1.0);
|
|
507
|
+
hsl.y = clamp(hsl.y + u_hslAdjust.y, 0.0, 1.0);
|
|
508
|
+
hsl.z = clamp(hsl.z + u_hslAdjust.z, 0.0, 1.0);
|
|
509
|
+
|
|
510
|
+
fragColor = vec4(hsl2rgb(hsl), color.a);
|
|
511
|
+
}
|
|
512
|
+
`,Zw=`#version 300 es
|
|
513
|
+
precision highp float;
|
|
514
|
+
|
|
515
|
+
in vec2 vUv;
|
|
516
|
+
out vec4 fragColor;
|
|
517
|
+
|
|
518
|
+
uniform sampler2D u_image_source; // texture
|
|
519
|
+
|
|
520
|
+
void main() {
|
|
521
|
+
fragColor = texture(u_image_source, vec2(vUv.x, 1.0-vUv.y));
|
|
522
|
+
}`,Qw=`#version 300 es
|
|
523
|
+
precision highp float;
|
|
524
|
+
|
|
525
|
+
uniform float u_time; // time
|
|
526
|
+
uniform vec2 u_resolution; // resolution
|
|
527
|
+
uniform vec2 u_mouse;
|
|
528
|
+
uniform float u_amplitude;
|
|
529
|
+
|
|
530
|
+
uniform float u_rotation; // [0, 6.28, 0]
|
|
531
|
+
uniform float u_density; // [10, 200, 30]
|
|
532
|
+
uniform float u_threshold;
|
|
533
|
+
uniform vec4 u_line_color; // color [0,0,0,0]
|
|
534
|
+
|
|
535
|
+
uniform sampler2D u_input_tex;
|
|
536
|
+
uniform float u_mode; // [0, 1, 1]
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
in vec2 vUv;
|
|
540
|
+
out vec4 fragColor;
|
|
541
|
+
|
|
542
|
+
const float PI = 3.1415926535897932384626433832795;
|
|
543
|
+
|
|
544
|
+
/*
|
|
545
|
+
angle is in radians
|
|
546
|
+
*/
|
|
547
|
+
vec2 rotate(vec2 uv, float angle) {
|
|
548
|
+
float c = cos(angle);
|
|
549
|
+
float s = sin(angle);
|
|
550
|
+
return mat2(c, -s, s, c) * uv;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
vec2 invRotate(vec2 uv, float angle) {
|
|
554
|
+
float c = cos(angle);
|
|
555
|
+
float s = sin(angle);
|
|
556
|
+
return mat2(c, s, -s, c) * uv;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
vec2 rotateCenter(vec2 uv, float angle) {
|
|
560
|
+
return rotate(uv - vec2(.5), u_rotation) + vec2(.5);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
void main() {
|
|
564
|
+
vec2 uv = vec2(vUv.x, vUv.y);
|
|
565
|
+
vec2 uvInRotatedSpace = invRotate(uv, u_rotation);
|
|
566
|
+
vec2 targetPixInRot = vec2(floor(uvInRotatedSpace.x * u_density + 0.5)/u_density, uvInRotatedSpace.y);
|
|
567
|
+
vec2 targetPixInRot2 = vec2(floor((uvInRotatedSpace.x) * u_density + 0.5)/u_density, uvInRotatedSpace.y + sin(u_mouse) / 20.0);
|
|
568
|
+
|
|
569
|
+
float distanceFromTargetInRot = smoothstep(0.0, 1.0, abs(targetPixInRot.x - uvInRotatedSpace.x) * 1.2) * 15.0 / (1.0 + u_amplitude * 5.0);
|
|
570
|
+
float maxDist = 1.0 / u_density;
|
|
571
|
+
|
|
572
|
+
vec2 targetInCart = invRotate(targetPixInRot, -u_rotation);
|
|
573
|
+
vec2 targetInCart2 = invRotate(targetPixInRot2, -u_rotation);
|
|
574
|
+
vec4 targetColor = (texture(u_input_tex, targetInCart) + texture(u_input_tex, targetInCart2)) * 0.5;
|
|
575
|
+
|
|
576
|
+
float targetLum = pow(dot(targetColor.rgb, vec3(0.299, 0.587, 0.114)), 2.0);
|
|
577
|
+
|
|
578
|
+
// 1.0 is solid; should be shaded. 0.0 should be white space
|
|
579
|
+
float solidMask = clamp(targetLum, 0.0, 1.0) < distanceFromTargetInRot * u_density ? 1.0 : 0.0;
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
if (u_mode > 0.5) {
|
|
583
|
+
if (solidMask < 0.5) {
|
|
584
|
+
fragColor = vec4(vec3(u_line_color), 1.0);
|
|
585
|
+
} else {
|
|
586
|
+
fragColor = vec4(1.0);
|
|
587
|
+
}
|
|
588
|
+
} else {
|
|
589
|
+
if (solidMask > 0.5) {
|
|
590
|
+
fragColor = vec4(vec3(u_line_color), 1.0);
|
|
591
|
+
} else {
|
|
592
|
+
fragColor = vec4(1.0);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
}`,Kw=`#version 300 es
|
|
597
|
+
precision mediump float;
|
|
598
|
+
|
|
599
|
+
uniform sampler2D u_texture; // input
|
|
600
|
+
uniform vec3 u_rgbAdjust; // RGB offset in [−255, 255] — [0, 0, 0]
|
|
601
|
+
|
|
602
|
+
in vec2 vUv;
|
|
603
|
+
out vec4 fragColor;
|
|
604
|
+
|
|
605
|
+
void main() {
|
|
606
|
+
vec4 color = texture(u_texture, vUv);
|
|
607
|
+
vec3 adjusted = clamp(color.rgb + u_rgbAdjust / 255.0, 0.0, 1.0);
|
|
608
|
+
fragColor = vec4(adjusted, color.a);
|
|
609
|
+
}
|
|
610
|
+
`,Jw=`#version 300 es
|
|
611
|
+
precision mediump float;
|
|
612
|
+
|
|
613
|
+
in vec2 vUv;
|
|
614
|
+
out vec4 fragColor;
|
|
615
|
+
|
|
616
|
+
uniform sampler2D u_texture_1;
|
|
617
|
+
uniform sampler2D u_texture_2;
|
|
618
|
+
|
|
619
|
+
void main() {
|
|
620
|
+
fragColor = clamp(
|
|
621
|
+
texture(u_texture_1, vUv) + texture(u_texture_2, vUv),
|
|
622
|
+
vec4(0.),
|
|
623
|
+
vec4(1.)
|
|
624
|
+
);
|
|
625
|
+
|
|
626
|
+
}`,Ww=`#version 300 es
|
|
627
|
+
precision mediump float;
|
|
628
|
+
|
|
629
|
+
in vec2 vUv;
|
|
630
|
+
out vec4 fragColor;
|
|
631
|
+
|
|
632
|
+
uniform sampler2D u_texture_1;
|
|
633
|
+
uniform sampler2D u_texture_2;
|
|
634
|
+
|
|
635
|
+
void main() {
|
|
636
|
+
fragColor = clamp(
|
|
637
|
+
texture(u_texture_1, vUv) - texture(u_texture_2, vUv),
|
|
638
|
+
vec4(0.),
|
|
639
|
+
vec4(1.)
|
|
640
|
+
);
|
|
641
|
+
|
|
642
|
+
}`,e3=`#version 300 es
|
|
643
|
+
precision mediump float;
|
|
644
|
+
|
|
645
|
+
in vec2 vUv;
|
|
646
|
+
out vec4 fragColor;
|
|
647
|
+
|
|
648
|
+
uniform sampler2D u_texture_1;
|
|
649
|
+
uniform sampler2D u_texture_2;
|
|
650
|
+
uniform float u_factor; // [0, 1, 0.5]
|
|
651
|
+
|
|
652
|
+
void main() {
|
|
653
|
+
fragColor = mix(
|
|
654
|
+
texture(u_texture_1, vUv),
|
|
655
|
+
texture(u_texture_2, vUv),
|
|
656
|
+
u_factor
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
`,t3=`#version 300 es
|
|
661
|
+
precision mediump float;
|
|
662
|
+
|
|
663
|
+
in vec2 vUv;
|
|
664
|
+
out vec4 fragColor;
|
|
665
|
+
|
|
666
|
+
uniform sampler2D u_texture_1;
|
|
667
|
+
uniform sampler2D u_texture_2;
|
|
668
|
+
|
|
669
|
+
void main() {
|
|
670
|
+
fragColor = clamp(
|
|
671
|
+
texture(u_texture_1, vUv) * texture(u_texture_2, vUv),
|
|
672
|
+
vec4(0.),
|
|
673
|
+
vec4(1.)
|
|
674
|
+
);
|
|
675
|
+
|
|
676
|
+
}`,n3=`#version 300 es
|
|
677
|
+
precision mediump float;
|
|
678
|
+
|
|
679
|
+
in vec2 vUv;
|
|
680
|
+
out vec4 fragColor;
|
|
681
|
+
|
|
682
|
+
uniform sampler2D u_texture_1;
|
|
683
|
+
uniform sampler2D u_texture_2;
|
|
684
|
+
|
|
685
|
+
void main() {
|
|
686
|
+
fragColor = clamp(
|
|
687
|
+
texture(u_texture_1, vUv) / (texture(u_texture_2, vUv) + 0.001),
|
|
688
|
+
vec4(0.),
|
|
689
|
+
vec4(1.)
|
|
690
|
+
);
|
|
691
|
+
}`,r3=`#version 300 es
|
|
692
|
+
precision mediump float;
|
|
693
|
+
|
|
694
|
+
uniform sampler2D u_texture;
|
|
695
|
+
uniform float u_blur_radius; // [0, 3, 0.1]
|
|
696
|
+
uniform vec2 u_resolution; // resolution
|
|
697
|
+
uniform vec2 u_center; // [0.5, 0.5]
|
|
698
|
+
uniform float u_blur_sample_count; // [2, 50, 5]
|
|
699
|
+
|
|
700
|
+
in vec2 vUv;
|
|
701
|
+
out vec4 fragColor;
|
|
702
|
+
|
|
703
|
+
void main() {
|
|
704
|
+
vec2 aspect = vec2(u_resolution.x / u_resolution.y, 1.0);
|
|
705
|
+
vec2 uv = vUv * aspect;
|
|
706
|
+
vec2 center = u_center * aspect;
|
|
707
|
+
|
|
708
|
+
vec2 offset = uv - center;
|
|
709
|
+
float r = atan(offset.y, offset.x);
|
|
710
|
+
float dist = length(offset);
|
|
711
|
+
|
|
712
|
+
vec4 result = vec4(0.);
|
|
713
|
+
|
|
714
|
+
int count = int(floor(u_blur_sample_count));
|
|
715
|
+
float invCount = 1.0 / float(count);
|
|
716
|
+
|
|
717
|
+
for (int i = 0; i < count; i++) {
|
|
718
|
+
float progress = float(i) * invCount;
|
|
719
|
+
float angle = r - u_blur_radius * 0.5 + progress * u_blur_radius;
|
|
720
|
+
|
|
721
|
+
vec2 rotated = vec2(cos(angle), sin(angle)) * dist;
|
|
722
|
+
|
|
723
|
+
vec2 sample_uv = center + rotated;
|
|
724
|
+
sample_uv /= aspect;
|
|
725
|
+
|
|
726
|
+
result += texture(u_texture, sample_uv);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
fragColor = result * invCount;
|
|
730
|
+
}
|
|
731
|
+
`,o3=`#version 300 es
|
|
732
|
+
precision mediump float;
|
|
733
|
+
|
|
734
|
+
in vec2 vUv;
|
|
735
|
+
out vec4 fragColor;
|
|
736
|
+
|
|
737
|
+
uniform sampler2D u_input_tex;
|
|
738
|
+
uniform float u_blur_dist; // [0, 1, 0.1]
|
|
739
|
+
uniform vec2 u_resolution; // resolution
|
|
740
|
+
uniform float u_angle; // [0, 10, 0]
|
|
741
|
+
uniform float u_blur_sample_count; // [2, 50, 5]
|
|
742
|
+
uniform float u_start_offset; // [0, 1, 0.5]
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
mat2 rotate2D(float angle) {
|
|
746
|
+
float c = cos(angle);
|
|
747
|
+
float s = sin(angle);
|
|
748
|
+
return mat2(
|
|
749
|
+
c, -s,
|
|
750
|
+
s, c
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
void main() {
|
|
755
|
+
vec2 aspect = vec2(
|
|
756
|
+
u_resolution.x / u_resolution.y,
|
|
757
|
+
1.0
|
|
758
|
+
);
|
|
759
|
+
|
|
760
|
+
vec2 uv = vUv * aspect;
|
|
761
|
+
|
|
762
|
+
mat2 rot_mat = rotate2D(u_angle);
|
|
763
|
+
mat2 inv_rot_mat = rotate2D(-u_angle);
|
|
764
|
+
vec2 rotated_uv = rot_mat * uv;
|
|
765
|
+
|
|
766
|
+
int count = int(floor(u_blur_sample_count));
|
|
767
|
+
|
|
768
|
+
vec4 result = vec4(0.0);
|
|
769
|
+
|
|
770
|
+
float offset_bias = u_blur_dist * u_start_offset;
|
|
771
|
+
|
|
772
|
+
for (int i = 0; i < count; i++) {
|
|
773
|
+
float offset = float(i) / float(count) * u_blur_dist - offset_bias;
|
|
774
|
+
vec2 target_pos = rotated_uv + vec2(offset, 0.0);
|
|
775
|
+
|
|
776
|
+
result += texture(
|
|
777
|
+
u_input_tex,
|
|
778
|
+
(inv_rot_mat * target_pos) / aspect
|
|
779
|
+
);
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
fragColor = result / float(count);
|
|
783
|
+
}`,i3=`#version 300 es
|
|
784
|
+
precision mediump float;
|
|
785
|
+
|
|
786
|
+
// from book of shaders
|
|
787
|
+
|
|
788
|
+
uniform vec2 u_resolution; // resolution
|
|
789
|
+
|
|
790
|
+
in vec2 vUv;
|
|
791
|
+
out vec4 fragColor;
|
|
792
|
+
|
|
793
|
+
float random (vec2 st) {
|
|
794
|
+
return fract(sin(dot(st.xy,
|
|
795
|
+
vec2(12.9898,78.233)))*
|
|
796
|
+
438758.5453123);
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
void main() {
|
|
800
|
+
vec2 st = vUv.xy/u_resolution.xy;
|
|
801
|
+
|
|
802
|
+
float rnd1 = random(st);
|
|
803
|
+
float rnd2 = random(st + rnd1);
|
|
804
|
+
float rnd3 = random(vec2(rnd1, rnd2));
|
|
805
|
+
float rnd4 = random(vec2(rnd1, rnd3));
|
|
806
|
+
|
|
807
|
+
fragColor = vec4(rnd1, rnd3, rnd4,1.0);
|
|
808
|
+
}`,a3=`#version 300 es
|
|
809
|
+
precision mediump float;
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
uniform sampler2D u_input_tex;
|
|
813
|
+
uniform vec2 u_resolution; // resolution
|
|
814
|
+
uniform float disperse_distance; // [0, 1, 0.1]
|
|
815
|
+
|
|
816
|
+
in vec2 vUv;
|
|
817
|
+
out vec4 fragColor;
|
|
818
|
+
|
|
819
|
+
float random (vec2 st) {
|
|
820
|
+
return fract(sin(dot(st.xy,
|
|
821
|
+
vec2(12.9898,78.233)))*
|
|
822
|
+
438758.5453123);
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
void main() {
|
|
826
|
+
vec2 aspect = vec2(
|
|
827
|
+
u_resolution.x / u_resolution.y,
|
|
828
|
+
1.0
|
|
829
|
+
);
|
|
830
|
+
vec2 uv = vUv.xy * aspect;
|
|
831
|
+
|
|
832
|
+
float rnd1 = random(uv);
|
|
833
|
+
float rnd2 = random(uv.yx);
|
|
834
|
+
|
|
835
|
+
fragColor = texture(u_input_tex,
|
|
836
|
+
(vec2(rnd1, rnd2) * disperse_distance - disperse_distance * 0.5 + uv)
|
|
837
|
+
/ aspect
|
|
838
|
+
);
|
|
839
|
+
}`,l3={key:Gw,dither:Xw,dots:Yw,daffodil:qw,diamonds:Iw,"gradient map":Pw,"hue/saturation/value":$w,"image viewer":Zw,"blur (radial)":r3,"blur (linear)":o3,noise:i3,dispersion:a3,lines:Qw,"color adjust":Kw,"mix (add)":Jw,"mix (subtract)":Ww,"mix (multiply)":t3,"mix (linear)":e3,"mix (divide)":n3};let Gh=Float32Array;function qh(t,r,o){const a=new Gh(3);return t&&(a[0]=t),r&&(a[1]=r),o&&(a[2]=o),a}function s3(t,r,o){return o=o||new Gh(3),o[0]=t[0]+r[0],o[1]=t[1]+r[1],o[2]=t[2]+r[2],o}function u3(t,r,o){return o=o||new Gh(3),o[0]=t[0]*r[0],o[1]=t[1]*r[1],o[2]=t[2]*r[2],o}let Ov=Float32Array;function c3(t){return t=t||new Ov(16),t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function f3(t,r){r=r||new Ov(16);const o=t[0],a=t[1],s=t[2],u=t[3],f=t[4],h=t[5],p=t[6],m=t[7],y=t[8],g=t[9],x=t[10],_=t[11],b=t[12],E=t[13],C=t[14],w=t[15],D=x*w,S=C*_,N=p*w,O=C*m,z=p*_,B=x*m,q=s*w,I=C*u,ae=s*_,V=x*u,$=s*m,ee=p*u,U=y*E,X=b*g,R=f*E,H=b*h,F=f*g,P=y*h,te=o*E,M=b*a,k=o*g,W=y*a,ne=o*h,se=f*a,he=D*h+O*g+z*E-(S*h+N*g+B*E),ce=S*a+q*g+V*E-(D*a+I*g+ae*E),ue=N*a+I*h+$*E-(O*a+q*h+ee*E),de=B*a+ae*h+ee*g-(z*a+V*h+$*g),ge=1/(o*he+f*ce+y*ue+b*de);return r[0]=ge*he,r[1]=ge*ce,r[2]=ge*ue,r[3]=ge*de,r[4]=ge*(S*f+N*y+B*b-(D*f+O*y+z*b)),r[5]=ge*(D*o+I*y+ae*b-(S*o+q*y+V*b)),r[6]=ge*(O*o+q*f+ee*b-(N*o+I*f+$*b)),r[7]=ge*(z*o+V*f+$*y-(B*o+ae*f+ee*y)),r[8]=ge*(U*m+H*_+F*w-(X*m+R*_+P*w)),r[9]=ge*(X*u+te*_+W*w-(U*u+M*_+k*w)),r[10]=ge*(R*u+M*m+ne*w-(H*u+te*m+se*w)),r[11]=ge*(P*u+k*m+se*_-(F*u+W*m+ne*_)),r[12]=ge*(R*x+P*C+X*p-(F*C+U*p+H*x)),r[13]=ge*(k*C+U*s+M*x-(te*x+W*C+X*s)),r[14]=ge*(te*p+se*C+H*s-(ne*C+R*s+M*p)),r[15]=ge*(ne*x+F*s+W*p-(k*p+se*x+P*s)),r}function d3(t,r,o){o=o||qh();const a=r[0],s=r[1],u=r[2],f=a*t[3]+s*t[7]+u*t[11]+t[15];return o[0]=(a*t[0]+s*t[4]+u*t[8]+t[12])/f,o[1]=(a*t[1]+s*t[5]+u*t[9]+t[13])/f,o[2]=(a*t[2]+s*t[6]+u*t[10]+t[14])/f,o}function h3(t,r,o){o=o||qh();const a=r[0],s=r[1],u=r[2];return o[0]=a*t[0]+s*t[4]+u*t[8],o[1]=a*t[1]+s*t[5]+u*t[9],o[2]=a*t[2]+s*t[6]+u*t[10],o}const Xh=5120,Wa=5121,Yh=5122,Ih=5123,Ph=5124,$h=5125,Zh=5126,m3=32819,p3=32820,g3=33635,y3=5131,x3=33640,v3=35899,b3=35902,_3=36269,E3=34042,zv={};{const t=zv;t[Xh]=Int8Array,t[Wa]=Uint8Array,t[Yh]=Int16Array,t[Ih]=Uint16Array,t[Ph]=Int32Array,t[$h]=Uint32Array,t[Zh]=Float32Array,t[m3]=Uint16Array,t[p3]=Uint16Array,t[g3]=Uint16Array,t[y3]=Uint16Array,t[x3]=Uint32Array,t[v3]=Uint32Array,t[b3]=Uint32Array,t[_3]=Uint32Array,t[E3]=Uint32Array}function Xu(t){if(t instanceof Int8Array)return Xh;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)return Wa;if(t instanceof Int16Array)return Yh;if(t instanceof Uint16Array)return Ih;if(t instanceof Int32Array)return Ph;if(t instanceof Uint32Array)return $h;if(t instanceof Float32Array)return Zh;throw new Error("unsupported typed array type")}function Bv(t){if(t===Int8Array)return Xh;if(t===Uint8Array||t===Uint8ClampedArray)return Wa;if(t===Int16Array)return Yh;if(t===Uint16Array)return Ih;if(t===Int32Array)return Ph;if(t===Uint32Array)return $h;if(t===Float32Array)return Zh;throw new Error("unsupported typed array type")}function Uv(t){const r=zv[t];if(!r)throw new Error("unknown gl type");return r}const el=typeof SharedArrayBuffer<"u"?function(r){return r&&r.buffer&&(r.buffer instanceof ArrayBuffer||r.buffer instanceof SharedArrayBuffer)}:function(r){return r&&r.buffer&&r.buffer instanceof ArrayBuffer};function S3(t,r,o){t.forEach(function(a){const s=r[a];s!==void 0&&(o[a]=s)})}function Hv(...t){console.error(...t)}const Fy=new Map;function Yu(t,r){if(!t||typeof t!="object")return!1;let o=Fy.get(r);o||(o=new WeakMap,Fy.set(r,o));let a=o.get(t);if(a===void 0){const s=Object.prototype.toString.call(t);a=s.substring(8,s.length-1)===r,o.set(t,a)}return a}function w3(t,r){return typeof WebGLBuffer<"u"&&Yu(r,"WebGLBuffer")}function A3(t,r){return typeof WebGLRenderbuffer<"u"&&Yu(r,"WebGLRenderbuffer")}function Qh(t,r){return typeof WebGLTexture<"u"&&Yu(r,"WebGLTexture")}function T3(t,r){return typeof WebGLSampler<"u"&&Yu(r,"WebGLSampler")}const Lv=35044,$r=34962,jv=34963,C3=34660,N3=5120,R3=5121,M3=5122,D3=5123,O3=5124,z3=5125,Fv=5126,kv={attribPrefix:""};function B3(t,r,o,a,s){t.bindBuffer(r,o),t.bufferData(r,a,s||Lv)}function Kh(t,r,o,a){if(w3(t,r))return r;o=o||$r;const s=t.createBuffer();return B3(t,o,s,r,a),s}function Vv(t){return t==="indices"}function U3(t){return t===Int8Array||t===Uint8Array}function Jh(t){return t.length?t:t.data}const H3=/coord|texture/i,L3=/color|colour/i;function j3(t,r){let o;if(H3.test(t)?o=2:L3.test(t)?o=4:o=3,r%o>0)throw new Error(`Can not guess numComponents for attribute '${t}'. Tried ${o} but ${r} values is not evenly divisible by ${o}. You should specify it.`);return o}function Wh(t,r,o){return t.numComponents||t.size||j3(r,o||Jh(t).length)}function Iu(t,r){if(el(t))return t;if(el(t.data))return t.data;Array.isArray(t)&&(t={data:t});let o=t.type?e0(t.type):void 0;return o||(Vv(r)?o=Uint16Array:o=Float32Array),new o(t.data)}function F3(t){return typeof t=="number"?t:t?Bv(t):Fv}function e0(t){return typeof t=="number"?Uv(t):t||Float32Array}function k3(t,r){return{buffer:r.buffer,numValues:24,type:F3(r.type),arrayType:e0(r.type)}}function V3(t,r){const o=r.data||r,a=e0(r.type),s=o*a.BYTES_PER_ELEMENT,u=t.createBuffer();return t.bindBuffer($r,u),t.bufferData($r,s,r.drawType||Lv),{buffer:u,numValues:o,type:Bv(a),arrayType:a}}function G3(t,r,o){const a=Iu(r,o);return{arrayType:a.constructor,buffer:Kh(t,a,void 0,r.drawType),type:Xu(a),numValues:0}}function q3(t,r){const o={};return Object.keys(r).forEach(function(a){if(!Vv(a)){const s=r[a],u=s.attrib||s.name||s.attribName||kv.attribPrefix+a;if(s.value){if(!Array.isArray(s.value)&&!el(s.value))throw new Error("array.value is not array or typedarray");o[u]={value:s.value}}else{let f;s.buffer&&s.buffer instanceof WebGLBuffer?f=k3:typeof s=="number"||typeof s.data=="number"?f=V3:f=G3;const{buffer:h,type:p,numValues:m,arrayType:y}=f(t,s,a),g=s.normalize!==void 0?s.normalize:U3(y),x=Wh(s,a,m);o[u]={buffer:h,numComponents:x,type:p,normalize:g,stride:s.stride||0,offset:s.offset||0,divisor:s.divisor===void 0?void 0:s.divisor,drawType:s.drawType}}}}),t.bindBuffer($r,null),o}function X3(t,r){return r===N3||r===R3?1:r===M3||r===D3?2:r===O3||r===z3||r===Fv?4:0}const Oi=["position","positions","a_position"];function Y3(t){let r,o;for(o=0;o<Oi.length&&(r=Oi[o],!(r in t));++o);o===Oi.length&&(r=Object.keys(t)[0]);const a=t[r],s=Jh(a).length;if(s===void 0)return 1;const u=Wh(a,r),f=s/u;if(s%u>0)throw new Error(`numComponents ${u} not correct for length ${s}`);return f}function I3(t,r){let o,a;for(a=0;a<Oi.length&&(o=Oi[a],!(o in r||(o=kv.attribPrefix+o,o in r)));++a);a===Oi.length&&(o=Object.keys(r)[0]);const s=r[o];if(!s.buffer)return 1;t.bindBuffer($r,s.buffer);const u=t.getBufferParameter($r,C3);t.bindBuffer($r,null);const f=X3(t,s.type),h=u/f,p=s.numComponents||s.size,m=h/p;if(m%1!==0)throw new Error(`numComponents ${p} not correct for length ${length}`);return m}function P3(t,r,o){const a=q3(t,r),s=Object.assign({},o||{});s.attribs=Object.assign({},o?o.attribs:{},a);const u=r.indices;if(u){const f=Iu(u,"indices");s.indices=Kh(t,f,jv),s.numElements=f.length,s.elementType=Xu(f)}else s.numElements||(s.numElements=I3(t,s.attribs));return s}function $3(t,r,o){const a=o==="indices"?jv:$r,s=Iu(r,o);return Kh(t,s,a)}function Z3(t,r){const o={};return Object.keys(r).forEach(function(a){o[a]=$3(t,r[a],a)}),r.indices?(o.numElements=r.indices.length,o.elementType=Xu(Iu(r.indices))):o.numElements=Y3(r),o}const Co=Jh,Q3=Wh;function Gv(t,r){let o=0;return t.push=function(){for(let a=0;a<arguments.length;++a){const s=arguments[a];if(s instanceof Array||el(s))for(let u=0;u<s.length;++u)t[o++]=s[u];else t[o++]=s}},t.reset=function(a){o=a||0},t.numComponents=r,Object.defineProperty(t,"numElements",{get:function(){return this.length/this.numComponents|0}}),t}function ze(t,r,o){const a=o||Float32Array;return Gv(new a(t*r),t)}function K3(t){return t!=="indices"}function J3(t){const r=t.indices,o={},a=r.length;function s(u){const f=t[u],h=f.numComponents,p=ze(h,a,f.constructor);for(let m=0;m<a;++m){const g=r[m]*h;for(let x=0;x<h;++x)p.push(f[g+x])}o[u]=p}return Object.keys(t).filter(K3).forEach(s),o}function W3(t){if(t.indices)throw new Error("can not flatten normals of indexed vertices. deindex them first");const r=t.normal,o=r.length;for(let a=0;a<o;a+=9){const s=r[a+0],u=r[a+1],f=r[a+2],h=r[a+3],p=r[a+4],m=r[a+5],y=r[a+6],g=r[a+7],x=r[a+8];let _=s+h+y,b=u+p+g,E=f+m+x;const C=Math.sqrt(_*_+b*b+E*E);_/=C,b/=C,E/=C,r[a+0]=_,r[a+1]=b,r[a+2]=E,r[a+3]=_,r[a+4]=b,r[a+5]=E,r[a+6]=_,r[a+7]=b,r[a+8]=E}return t}function t0(t,r,o){const a=t.length,s=new Float32Array(3);for(let u=0;u<a;u+=3)o(r,[t[u],t[u+1],t[u+2]],s),t[u]=s[0],t[u+1]=s[1],t[u+2]=s[2]}function eA(t,r,o){o=o||qh();const a=r[0],s=r[1],u=r[2];return o[0]=a*t[0]+s*t[1]+u*t[2],o[1]=a*t[4]+s*t[5]+u*t[6],o[2]=a*t[8]+s*t[9]+u*t[10],o}function qv(t,r){return t0(t,r,h3),t}function Xv(t,r){return t0(t,f3(r),eA),t}function Yv(t,r){return t0(t,r,d3),t}function Iv(t,r){return Object.keys(t).forEach(function(o){const a=t[o];o.indexOf("pos")>=0?Yv(a,r):o.indexOf("tan")>=0||o.indexOf("binorm")>=0?qv(a,r):o.indexOf("norm")>=0&&Xv(a,r)}),t}function n0(t,r,o){return t=t||2,r=r||0,o=o||0,t*=.5,{position:{numComponents:2,data:[r+-1*t,o+-1*t,r+1*t,o+-1*t,r+-1*t,o+1*t,r+1*t,o+1*t]},normal:[0,0,1,0,0,1,0,0,1,0,0,1],texcoord:[0,0,1,0,0,1,1,1],indices:[0,1,2,2,1,3]}}function r0(t,r,o,a,s){t=t||1,r=r||1,o=o||1,a=a||1,s=s||c3();const u=(o+1)*(a+1),f=ze(3,u),h=ze(3,u),p=ze(2,u);for(let x=0;x<=a;x++)for(let _=0;_<=o;_++){const b=_/o,E=x/a;f.push(t*b-t*.5,0,r*E-r*.5),h.push(0,1,0),p.push(b,E)}const m=o+1,y=ze(3,o*a*2,Uint16Array);for(let x=0;x<a;x++)for(let _=0;_<o;_++)y.push((x+0)*m+_,(x+1)*m+_,(x+0)*m+_+1),y.push((x+1)*m+_,(x+1)*m+_+1,(x+0)*m+_+1);return Iv({position:f,normal:h,texcoord:p,indices:y},s)}function o0(t,r,o,a,s,u,f){if(r<=0||o<=0)throw new Error("subdivisionAxis and subdivisionHeight must be > 0");a=a||0,s=s||Math.PI,u=u||0,f=f||Math.PI*2;const h=s-a,p=f-u,m=(r+1)*(o+1),y=ze(3,m),g=ze(3,m),x=ze(2,m);for(let E=0;E<=o;E++)for(let C=0;C<=r;C++){const w=C/r,D=E/o,S=p*w+u,N=h*D+a,O=Math.sin(S),z=Math.cos(S),B=Math.sin(N),q=Math.cos(N),I=z*B,ae=q,V=O*B;y.push(t*I,t*ae,t*V),g.push(I,ae,V),x.push(1-w,D)}const _=r+1,b=ze(3,r*o*2,Uint16Array);for(let E=0;E<r;E++)for(let C=0;C<o;C++)b.push((C+0)*_+E,(C+0)*_+E+1,(C+1)*_+E),b.push((C+1)*_+E,(C+0)*_+E+1,(C+1)*_+E+1);return{position:y,normal:g,texcoord:x,indices:b}}const tA=[[3,7,5,1],[6,2,0,4],[6,7,3,2],[0,1,5,4],[7,6,4,5],[2,3,1,0]];function i0(t){t=t||1;const r=t/2,o=[[-r,-r,-r],[+r,-r,-r],[-r,+r,-r],[+r,+r,-r],[-r,-r,+r],[+r,-r,+r],[-r,+r,+r],[+r,+r,+r]],a=[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],s=[[1,0],[0,0],[0,1],[1,1]],u=24,f=ze(3,u),h=ze(3,u),p=ze(2,u),m=ze(3,12,Uint16Array);for(let y=0;y<6;++y){const g=tA[y];for(let _=0;_<4;++_){const b=o[g[_]],E=a[y],C=s[_];f.push(b),h.push(E),p.push(C)}const x=4*y;m.push(x+0,x+1,x+2),m.push(x+0,x+2,x+3)}return{position:f,normal:h,texcoord:p,indices:m}}function Pu(t,r,o,a,s,u,f){if(a<3)throw new Error("radialSubdivisions must be 3 or greater");if(s<1)throw new Error("verticalSubdivisions must be 1 or greater");const h=u===void 0?!0:u,p=f===void 0?!0:f,m=(h?2:0)+(p?2:0),y=(a+1)*(s+1+m),g=ze(3,y),x=ze(3,y),_=ze(2,y),b=ze(3,a*(s+m/2)*2,Uint16Array),E=a+1,C=Math.atan2(t-r,o),w=Math.cos(C),D=Math.sin(C),S=h?-2:0,N=s+(p?2:0);for(let O=S;O<=N;++O){let z=O/s,B=o*z,q;O<0?(B=0,z=1,q=t):O>s?(B=o,z=1,q=r):q=t+(r-t)*(O/s),(O===-2||O===s+2)&&(q=0,z=0),B-=o/2;for(let I=0;I<E;++I){const ae=Math.sin(I*Math.PI*2/a),V=Math.cos(I*Math.PI*2/a);g.push(ae*q,B,V*q),O<0?x.push(0,-1,0):O>s?x.push(0,1,0):q===0?x.push(0,0,0):x.push(ae*w,D,V*w),_.push(I/a,1-z)}}for(let O=0;O<s+m;++O)if(!(O===1&&h||O===s+m-2&&p))for(let z=0;z<a;++z)b.push(E*(O+0)+0+z,E*(O+0)+1+z,E*(O+1)+1+z),b.push(E*(O+0)+0+z,E*(O+1)+1+z,E*(O+1)+0+z);return{position:g,normal:x,texcoord:_,indices:b}}function ky(t,r){r=r||[];const o=[];for(let a=0;a<t.length;a+=4){const s=t[a],u=t.slice(a+1,a+4);u.push.apply(u,r);for(let f=0;f<s;++f)o.push.apply(o,u)}return o}function a0(){const t=[0,0,0,0,150,0,30,0,0,0,150,0,30,150,0,30,0,0,30,0,0,30,30,0,100,0,0,30,30,0,100,30,0,100,0,0,30,60,0,30,90,0,67,60,0,30,90,0,67,90,0,67,60,0,0,0,30,30,0,30,0,150,30,0,150,30,30,0,30,30,150,30,30,0,30,100,0,30,30,30,30,30,30,30,100,0,30,100,30,30,30,60,30,67,60,30,30,90,30,30,90,30,67,60,30,67,90,30,0,0,0,100,0,0,100,0,30,0,0,0,100,0,30,0,0,30,100,0,0,100,30,0,100,30,30,100,0,0,100,30,30,100,0,30,30,30,0,30,30,30,100,30,30,30,30,0,100,30,30,100,30,0,30,30,0,30,60,30,30,30,30,30,30,0,30,60,0,30,60,30,30,60,0,67,60,30,30,60,30,30,60,0,67,60,0,67,60,30,67,60,0,67,90,30,67,60,30,67,60,0,67,90,0,67,90,30,30,90,0,30,90,30,67,90,30,30,90,0,67,90,30,67,90,0,30,90,0,30,150,30,30,90,30,30,90,0,30,150,0,30,150,30,0,150,0,0,150,30,30,150,30,0,150,0,30,150,30,30,150,0,0,0,0,0,0,30,0,150,30,0,0,0,0,150,30,0,150,0],r=[.22,.19,.22,.79,.34,.19,.22,.79,.34,.79,.34,.19,.34,.19,.34,.31,.62,.19,.34,.31,.62,.31,.62,.19,.34,.43,.34,.55,.49,.43,.34,.55,.49,.55,.49,.43,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,1,1,1,0],o=ky([18,0,0,1,18,0,0,-1,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,-1,0,6,-1,0,0]),a=ky([18,200,70,120,18,80,70,200,6,70,200,210,6,200,200,70,6,210,100,70,6,210,160,70,6,70,180,210,6,100,70,210,6,76,210,100,6,140,210,80,6,90,130,110,6,160,160,220],[255]),s=t.length/3,u={position:ze(3,s),texcoord:ze(2,s),normal:ze(3,s),color:ze(4,s,Uint8Array),indices:ze(3,s/3,Uint16Array)};u.position.push(t),u.texcoord.push(r),u.normal.push(o),u.color.push(a);for(let f=0;f<s;++f)u.indices.push(f);return u}function $u(t,r,o,a,s,u,f){if(s<=0)throw new Error("subdivisionDown must be > 0");u=u||0,f=f||1;const h=2,p=f-u,m=(s+1)*2*(2+h),y=ze(3,m),g=ze(3,m),x=ze(2,m);function _(D,S,N){return D+(S-D)*N}function b(D,S,N,O,z,B){for(let q=0;q<=s;q++){const I=S/(h-1),ae=q/s,V=(I-.5)*2,$=(u+ae*p)*Math.PI,ee=Math.sin($),U=Math.cos($),X=_(t,D,ee),R=V*a,H=U*t,F=ee*X;y.push(R,H,F);const P=s3(u3([0,ee,U],N),O);g.push(P),x.push(I*z+B,ae)}}for(let D=0;D<h;D++){const S=(D/(h-1)-.5)*2;b(r,D,[1,1,1],[0,0,0],1,0),b(r,D,[0,0,0],[S,0,0],0,0),b(o,D,[1,1,1],[0,0,0],1,0),b(o,D,[0,0,0],[S,0,0],0,1)}const E=ze(3,s*2*(2+h),Uint16Array);function C(D,S){for(let N=0;N<s;++N)E.push(D+N+0,D+N+1,S+N+0),E.push(D+N+1,S+N+1,S+N+0)}const w=s+1;return C(w*0,w*4),C(w*5,w*7),C(w*6,w*2),C(w*3,w*1),{position:y,normal:g,texcoord:x,indices:E}}function l0(t,r,o,a,s,u){return Pu(t,t,r,o,a,s,u)}function s0(t,r,o,a,s,u){if(o<3)throw new Error("radialSubdivisions must be 3 or greater");if(a<3)throw new Error("verticalSubdivisions must be 3 or greater");s=s||0,u=u||Math.PI*2;const f=u-s,h=o+1,p=a+1,m=h*p,y=ze(3,m),g=ze(3,m),x=ze(2,m),_=ze(3,o*a*2,Uint16Array);for(let b=0;b<p;++b){const E=b/a,C=E*Math.PI*2,w=Math.sin(C),D=t+w*r,S=Math.cos(C),N=S*r;for(let O=0;O<h;++O){const z=O/o,B=s+z*f,q=Math.sin(B),I=Math.cos(B),ae=q*D,V=I*D,$=q*w,ee=I*w;y.push(ae,N,V),g.push($,S,ee),x.push(z,1-E)}}for(let b=0;b<a;++b)for(let E=0;E<o;++E){const C=1+E,w=1+b;_.push(h*b+E,h*w+E,h*b+C),_.push(h*w+E,h*w+C,h*b+C)}return{position:y,normal:g,texcoord:x,indices:_}}function u0(t,r,o,a,s){if(r<3)throw new Error("divisions must be at least 3");o=o||1,s=s||1,a=a||0;const u=(r+1)*(o+1),f=ze(3,u),h=ze(3,u),p=ze(2,u),m=ze(3,o*r*2,Uint16Array);let y=0;const g=t-a,x=r+1;for(let _=0;_<=o;++_){const b=a+g*Math.pow(_/o,s);for(let E=0;E<=r;++E){const C=2*Math.PI*E/r,w=b*Math.cos(C),D=b*Math.sin(C);if(f.push(w,0,D),h.push(0,1,0),p.push(1-E/r,_/o),_>0&&E!==r){const S=y+(E+1),N=y+E,O=y+E-x,z=y+(E+1)-x;m.push(S,N,O),m.push(S,O,z)}}y+=r+1}return{position:f,normal:h,texcoord:p,indices:m}}function nA(t){return Math.random()*t|0}function rA(t,r){r=r||{};const o=t.position.numElements,a=ze(4,o,Uint8Array),s=r.rand||function(u,f){return f<3?nA(256):255};if(t.color=a,t.indices)for(let u=0;u<o;++u)a.push(s(u,0),s(u,1),s(u,2),s(u,3));else{const u=r.vertsPerColor||3,f=o/u;for(let h=0;h<f;++h){const p=[s(h,0),s(h,1),s(h,2),s(h,3)];for(let m=0;m<u;++m)a.push(p)}}return t}function Ln(t){return function(r){const o=t.apply(this,Array.prototype.slice.call(arguments,1));return Z3(r,o)}}function jn(t){return function(r){const o=t.apply(null,Array.prototype.slice.call(arguments,1));return P3(r,o)}}const oA=["numComponents","size","type","normalize","stride","offset","attrib","name","attribName"];function mh(t,r,o,a){a=a||0;const s=t.length;for(let u=0;u<s;++u)r[o+u]=t[u]+a}function Pv(t,r){const o=Co(t),a=new o.constructor(r);let s=a;return o.numComponents&&o.numElements&&Gv(a,o.numComponents),t.data&&(s={data:a},S3(oA,t,s)),s}function iA(t){const r={};let o;for(let h=0;h<t.length;++h){const p=t[h];Object.keys(p).forEach(function(m){r[m]||(r[m]=[]),!o&&m!=="indices"&&(o=m);const y=p[m],g=Q3(y,m),_=Co(y).length/g;r[m].push(_)})}function a(h){let p=0,m;for(let y=0;y<t.length;++y){const x=t[y][h],_=Co(x);p+=_.length,(!m||x.data)&&(m=x)}return{length:p,spec:m}}function s(h,p,m){let y=0,g=0;for(let x=0;x<t.length;++x){const b=t[x][h],E=Co(b);h==="indices"?(mh(E,m,g,y),y+=p[x]):mh(E,m,g),g+=E.length}}const u=r[o],f={};return Object.keys(r).forEach(function(h){const p=a(h),m=Pv(p.spec,p.length);s(h,u,Co(m)),f[h]=m}),f}function aA(t){const r={};return Object.keys(t).forEach(function(o){const a=t[o],s=Co(a),u=Pv(a,s.length);mh(s,Co(u),0),r[o]=u}),r}const lA=jn(a0),sA=Ln(a0),uA=jn(i0),cA=Ln(i0),fA=jn(r0),dA=Ln(r0),hA=jn(o0),mA=Ln(o0),pA=jn(Pu),gA=Ln(Pu),yA=jn(n0),xA=Ln(n0),$v=jn($u),Zv=Ln($u),vA=jn(l0),bA=Ln(l0),_A=jn(s0),EA=Ln(s0),SA=jn(u0),wA=Ln(u0),AA=$v,TA=Zv,CA=$u;var NA=Object.freeze({__proto__:null,create3DFBufferInfo:lA,create3DFBuffers:sA,create3DFVertices:a0,createAugmentedTypedArray:ze,createCubeBufferInfo:uA,createCubeBuffers:cA,createCubeVertices:i0,createPlaneBufferInfo:fA,createPlaneBuffers:dA,createPlaneVertices:r0,createSphereBufferInfo:hA,createSphereBuffers:mA,createSphereVertices:o0,createTruncatedConeBufferInfo:pA,createTruncatedConeBuffers:gA,createTruncatedConeVertices:Pu,createXYQuadBufferInfo:yA,createXYQuadBuffers:xA,createXYQuadVertices:n0,createCresentBufferInfo:AA,createCresentBuffers:TA,createCresentVertices:CA,createCrescentBufferInfo:$v,createCrescentBuffers:Zv,createCrescentVertices:$u,createCylinderBufferInfo:vA,createCylinderBuffers:bA,createCylinderVertices:l0,createTorusBufferInfo:_A,createTorusBuffers:EA,createTorusVertices:s0,createDiscBufferInfo:SA,createDiscBuffers:wA,createDiscVertices:u0,deindexVertices:J3,flattenNormals:W3,makeRandomVertexColors:rA,reorientDirections:qv,reorientNormals:Xv,reorientPositions:Yv,reorientVertices:Iv,concatVertices:iA,duplicateVertices:aA});function ml(t){return!!t.texStorage2D}const Qv=(function(){const t={},r={};function o(a){const s=a.constructor.name;if(!t[s]){for(const u in a)if(typeof a[u]=="number"){const f=r[a[u]];r[a[u]]=f?`${f} | ${u}`:u}t[s]=!0}}return function(s,u){return o(s),r[u]||(typeof u=="number"?`0x${u.toString(16)}`:u)}})(),qa=void 0,Qr={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},tl=el,Kv=(function(){let t;return function(){return t=t||(typeof document<"u"&&document.createElement?document.createElement("canvas").getContext("2d"):null),t}})(),Vy=6406,Mn=6407,nt=6408,Gy=6409,qy=6410,Xa=6402,Xy=34041,wu=33071,kd=9728,Vd=9729,RA=9986,ur=3553,cr=34067,Lo=32879,Oo=35866,c0=34069,MA=34070,DA=34071,OA=34072,zA=34073,BA=34074,Au=10241,Tu=10240,Cu=10242,Nu=10243,Yy=32882,UA=33082,HA=33083,LA=33084,jA=33085,FA=34892,kA=34893,f0=3317,Jv=3314,Wv=32878,eb=3316,tb=3315,nb=32877,gu=37443,yu=37441,xu=37440,VA=33321,GA=36756,qA=33325,XA=33326,YA=33330,IA=33329,PA=33338,$A=33337,ZA=33340,QA=33339,KA=33323,JA=36757,WA=33327,eT=33328,tT=33336,nT=33335,rT=33332,oT=33331,iT=33334,aT=33333,lT=32849,sT=35905,uT=36194,cT=36758,fT=35898,dT=35901,hT=34843,mT=34837,pT=36221,gT=36239,yT=36215,xT=36233,vT=36209,bT=36227,_T=32856,ET=35907,ST=36759,wT=32855,AT=32854,TT=32857,CT=34842,NT=34836,RT=36220,MT=36238,DT=36975,OT=36214,zT=36232,BT=36226,UT=36208,HT=33189,LT=33190,jT=36012,FT=36013,kT=35056,Gr=5120,Ke=5121,Qs=5122,Ai=5123,Ks=5124,wo=5125,Ct=5126,Iy=32819,Py=32820,$y=33635,pn=5131,Ya=36193,Gd=33640,VT=35899,GT=35902,qT=36269,XT=34042,Js=33319,Ti=33320,Ws=6403,Ci=36244,Ni=36248,Ao=36249,Zy=33776,Qy=33777,Ky=33778,Jy=33779,Wy=35916,ex=35917,tx=35918,nx=35919,rx=36196,ox=37488,ix=37489,ax=37490,lx=37491,sx=37492,ux=37493,cx=37494,fx=37495,dx=37496,hx=37497,mx=35840,px=35841,gx=35842,yx=35843,xx=37808,vx=37809,bx=37810,_x=37811,Ex=37812,Sx=37813,wx=37814,Ax=37815,Tx=37816,Cx=37817,Nx=37818,Rx=37819,Mx=37820,Dx=37821,Ox=37840,zx=37841,Bx=37842,Ux=37843,Hx=37844,Lx=37845,jx=37846,Fx=37847,kx=37848,Vx=37849,Gx=37850,qx=37851,Xx=37852,Yx=37853,Ix=36492,Px=36493,$x=36494,Zx=36495,Qx=36283,Kx=36284,Jx=36285,Wx=36286;let qd;function Xi(t){if(!qd){const o={};o[Vy]={textureFormat:Vy,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[Ke,pn,Ya,Ct]},o[Gy]={textureFormat:Gy,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[Ke,pn,Ya,Ct]},o[qy]={textureFormat:qy,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[Ke,pn,Ya,Ct]},o[Mn]={textureFormat:Mn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[Ke,pn,Ya,Ct,$y]},o[nt]={textureFormat:nt,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[Ke,pn,Ya,Ct,Iy,Py]},o[Xa]={textureFormat:Xa,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[wo,Ai]},o[VA]={textureFormat:Ws,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1],type:[Ke]},o[GA]={textureFormat:Ws,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[1],type:[Gr]},o[qA]={textureFormat:Ws,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[Ct,pn]},o[XA]={textureFormat:Ws,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[4],type:[Ct]},o[YA]={textureFormat:Ci,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[Ke]},o[IA]={textureFormat:Ci,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[Gr]},o[rT]={textureFormat:Ci,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Ai]},o[oT]={textureFormat:Ci,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Qs]},o[iT]={textureFormat:Ci,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[wo]},o[aT]={textureFormat:Ci,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ks]},o[KA]={textureFormat:Js,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2],type:[Ke]},o[JA]={textureFormat:Js,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[2],type:[Gr]},o[WA]={textureFormat:Js,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[Ct,pn]},o[eT]={textureFormat:Js,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[8],type:[Ct]},o[tT]={textureFormat:Ti,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Ke]},o[nT]={textureFormat:Ti,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Gr]},o[PA]={textureFormat:Ti,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ai]},o[$A]={textureFormat:Ti,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Qs]},o[ZA]={textureFormat:Ti,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[wo]},o[QA]={textureFormat:Ti,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Ks]},o[lT]={textureFormat:Mn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3],type:[Ke]},o[sT]={textureFormat:Mn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[Ke]},o[uT]={textureFormat:Mn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[Ke,$y]},o[cT]={textureFormat:Mn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[Gr]},o[fT]={textureFormat:Mn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[Ct,pn,VT]},o[dT]={textureFormat:Mn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[Ct,pn,GT]},o[hT]={textureFormat:Mn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[Ct,pn]},o[mT]={textureFormat:Mn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Ct]},o[pT]={textureFormat:Ni,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[Ke]},o[gT]={textureFormat:Ni,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[Gr]},o[yT]={textureFormat:Ni,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[Ai]},o[xT]={textureFormat:Ni,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[Qs]},o[vT]={textureFormat:Ni,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[wo]},o[bT]={textureFormat:Ni,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Ks]},o[_T]={textureFormat:nt,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Ke]},o[ET]={textureFormat:nt,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Ke]},o[ST]={textureFormat:nt,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4],type:[Gr]},o[wT]={textureFormat:nt,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[Ke,Py,Gd]},o[AT]={textureFormat:nt,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[Ke,Iy]},o[TT]={textureFormat:nt,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Gd]},o[CT]={textureFormat:nt,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[Ct,pn]},o[NT]={textureFormat:nt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[16],type:[Ct]},o[RT]={textureFormat:Ao,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ke]},o[MT]={textureFormat:Ao,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Gr]},o[DT]={textureFormat:Ao,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Gd]},o[OT]={textureFormat:Ao,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Ai]},o[zT]={textureFormat:Ao,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Qs]},o[BT]={textureFormat:Ao,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[Ks]},o[UT]={textureFormat:Ao,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[wo]},o[HT]={textureFormat:Xa,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[Ai,wo]},o[LT]={textureFormat:Xa,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[wo]},o[jT]={textureFormat:Xa,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ct]},o[kT]={textureFormat:Xy,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[XT]},o[FT]={textureFormat:Xy,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[qT]},Object.keys(o).forEach(function(u){const f=o[u];f.bytesPerElementMap={},f.bytesPerElement.forEach(function(h,p){const m=f.type[p];f.bytesPerElementMap[m]=h})});const a={bytes:8,width:4,height:4},s={bytes:16,width:4,height:4};o[Zy]={textureFormat:Zy,colorRenderable:!1,textureFilterable:!0,block:a},o[Qy]={textureFormat:Qy,colorRenderable:!1,textureFilterable:!0,block:a},o[Ky]={textureFormat:Ky,colorRenderable:!1,textureFilterable:!0,block:s},o[Jy]={textureFormat:Jy,colorRenderable:!1,textureFilterable:!0,block:s},o[Wy]={textureFormat:Wy,colorRenderable:!1,textureFilterable:!0,block:a},o[ex]={textureFormat:ex,colorRenderable:!1,textureFilterable:!0,block:a},o[tx]={textureFormat:tx,colorRenderable:!1,textureFilterable:!0,block:s},o[nx]={textureFormat:nx,colorRenderable:!1,textureFilterable:!0,block:s},o[rx]={textureFormat:rx,colorRenderable:!1,textureFilterable:!0,block:a},o[ox]={textureFormat:ox,colorRenderable:!1,textureFilterable:!0,block:a},o[ix]={textureFormat:ix,colorRenderable:!1,textureFilterable:!0,block:a},o[ax]={textureFormat:ax,colorRenderable:!1,textureFilterable:!0,block:s},o[lx]={textureFormat:lx,colorRenderable:!1,textureFilterable:!0,block:s},o[sx]={textureFormat:sx,colorRenderable:!1,textureFilterable:!0,block:a},o[ux]={textureFormat:ux,colorRenderable:!1,textureFilterable:!0,block:a},o[cx]={textureFormat:cx,colorRenderable:!1,textureFilterable:!0,block:a},o[fx]={textureFormat:fx,colorRenderable:!1,textureFilterable:!0,block:a},o[dx]={textureFormat:dx,colorRenderable:!1,textureFilterable:!0,block:s},o[hx]={textureFormat:hx,colorRenderable:!1,textureFilterable:!0,block:s},o[mx]={textureFormat:mx,colorRenderable:!1,textureFilterable:!0,block:{bytes:32,width:8,height:8}},o[px]={textureFormat:px,colorRenderable:!1,textureFilterable:!0,block:{bytes:32,width:16,height:8}},o[gx]={textureFormat:gx,colorRenderable:!1,textureFilterable:!0,block:{bytes:32,width:8,height:8}},o[yx]={textureFormat:yx,colorRenderable:!1,textureFilterable:!0,block:{bytes:32,width:16,height:8}},o[xx]={textureFormat:xx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:4,height:4}},o[vx]={textureFormat:vx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:5,height:4}},o[bx]={textureFormat:bx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:5,height:5}},o[_x]={textureFormat:_x,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:6,height:5}},o[Ex]={textureFormat:Ex,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:6,height:6}},o[Sx]={textureFormat:Sx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:5}},o[wx]={textureFormat:wx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:6}},o[Ax]={textureFormat:Ax,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:8}},o[Tx]={textureFormat:Tx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:5}},o[Cx]={textureFormat:Cx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:6}},o[Nx]={textureFormat:Nx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:8}},o[Rx]={textureFormat:Rx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:10}},o[Mx]={textureFormat:Mx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:12,height:10}},o[Dx]={textureFormat:Dx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:12,height:12}},o[Ox]={textureFormat:Ox,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:4,height:4}},o[zx]={textureFormat:zx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:5,height:4}},o[Bx]={textureFormat:Bx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:5,height:5}},o[Ux]={textureFormat:Ux,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:6,height:5}},o[Hx]={textureFormat:Hx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:6,height:6}},o[Lx]={textureFormat:Lx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:5}},o[jx]={textureFormat:jx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:6}},o[Fx]={textureFormat:Fx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:8}},o[kx]={textureFormat:kx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:5}},o[Vx]={textureFormat:Vx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:6}},o[Gx]={textureFormat:Gx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:8}},o[qx]={textureFormat:qx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:10}},o[Xx]={textureFormat:Xx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:12,height:10}},o[Yx]={textureFormat:Yx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:12,height:12}},o[Ix]={textureFormat:Ix,colorRenderable:!1,textureFilterable:!0,block:s},o[Px]={textureFormat:Px,colorRenderable:!1,textureFilterable:!0,block:s},o[$x]={textureFormat:$x,colorRenderable:!1,textureFilterable:!0,block:s},o[Zx]={textureFormat:Zx,colorRenderable:!1,textureFilterable:!0,block:s},o[Qx]={textureFormat:Qx,colorRenderable:!1,textureFilterable:!0,block:a},o[Kx]={textureFormat:Kx,colorRenderable:!1,textureFilterable:!0,block:a},o[Jx]={textureFormat:Jx,colorRenderable:!1,textureFilterable:!0,block:a},o[Wx]={textureFormat:Wx,colorRenderable:!1,textureFilterable:!0,block:a},qd=o}const r=qd[t];if(!r)throw new Error("unknown internal format");return r}function rb(t,r){const a=Xi(t).bytesPerElementMap[r];if(a===void 0)throw new Error("type not supported for internal format");return a}function pl(t){const r=Xi(t);if(!r)throw new Error("unknown internal format");return{format:r.textureFormat,type:r.type?.[0]??Ke}}function ob(t){return!!Xi(t).block}function YT(t,r){const o=Xi(t);return o.block?{blockWidth:o.block.width,blockHeight:o.block.height,bytesPerBlock:o.block.bytes}:{blockWidth:1,blockHeight:1,bytesPerBlock:rb(t,r)}}function e1(t){return(t&t-1)===0}function IT(t,r,o,a){if(!ml(t))return e1(r)&&e1(o);const s=Xi(a);return s.colorRenderable&&s.textureFilterable}function Xd(t){return Xi(t).textureFilterable}function PT(t,r,o){return tl(r)?Xu(r):o||Ke}function eu(t,r,o,a,s){if(s%1!==0)throw new Error("can't guess dimensions");if(!o&&!a){const u=Math.sqrt(s/(r===cr?6:1));u%1===0?(o=u,a=u):(o=s,a=1)}else if(a){if(!o&&(o=s/a,o%1))throw new Error("can't guess dimensions")}else if(a=s/o,a%1)throw new Error("can't guess dimensions");return{width:o,height:a}}function Ir(t,r,o){let a,s,u;r.colorspaceConversion!==void 0&&(a=t.getParameter(gu),t.pixelStorei(gu,r.colorspaceConversion)),r.premultiplyAlpha!==void 0&&(s=t.getParameter(yu),t.pixelStorei(yu,r.premultiplyAlpha)),r.flipY!==void 0&&(u=t.getParameter(xu),t.pixelStorei(xu,r.flipY)),o(),a!==void 0&&t.pixelStorei(gu,a),s!==void 0&&t.pixelStorei(yu,s),u!==void 0&&t.pixelStorei(xu,u)}function Yd(t,r,o,a){const s=r[o];return{[o]:s===void 0?t.getParameter(a):s}}function d0(t,r){return{...r,...Yd(t,r,"flipY",xu),...Yd(t,r,"premultiplyAlpha",yu),...Yd(t,r,"colorspaceConversion",gu)}}function ib(t){t.pixelStorei(f0,4),ml(t)&&(t.pixelStorei(Jv,0),t.pixelStorei(Wv,0),t.pixelStorei(eb,0),t.pixelStorei(tb,0),t.pixelStorei(nb,0))}function $T(t,r,o,a){a.minMag&&(o.call(t,r,Au,a.minMag),o.call(t,r,Tu,a.minMag)),a.min&&o.call(t,r,Au,a.min),a.mag&&o.call(t,r,Tu,a.mag),a.wrap&&(o.call(t,r,Cu,a.wrap),o.call(t,r,Nu,a.wrap),(r===Lo||T3(t,r))&&o.call(t,r,Yy,a.wrap)),a.wrapR&&o.call(t,r,Yy,a.wrapR),a.wrapS&&o.call(t,r,Cu,a.wrapS),a.wrapT&&o.call(t,r,Nu,a.wrapT),a.minLod!==void 0&&o.call(t,r,UA,a.minLod),a.maxLod!==void 0&&o.call(t,r,HA,a.maxLod),a.baseLevel!==void 0&&o.call(t,r,LA,a.baseLevel),a.maxLevel!==void 0&&o.call(t,r,jA,a.maxLevel),a.compareFunc!==void 0&&o.call(t,r,kA,a.compareFunc),a.compareMode!==void 0&&o.call(t,r,FA,a.compareMode)}function ab(t,r,o){const a=o.target||ur;t.bindTexture(a,r),$T(t,a,t.texParameteri,o)}function ZT(t){return t=t||Qr.textureColor,tl(t)?t:new Uint8Array([t[0]*255,t[1]*255,t[2]*255,t[3]*255])}function lb(t,r,{options:o,width:a,height:s,internalFormat:u,lastMipLevelUploaded:f}){o=o||Qr.textureOptions,u=u||nt;const h=o.target||ur;if(a=a||o.width,s=s||o.height,t.bindTexture(h,r),f>1){const p=Math.max(1,a>>f),m=Math.max(1,s>>f),y=p===1&&m===1,g=Xd(u)?Vd:kd,x=Xd(u)?y?RA:Vd:kd;t.texParameteri(h,Tu,g),t.texParameteri(h,Au,x)}else if(IT(t,a,s,u))t.generateMipmap(h);else{const p=Xd(u)?Vd:kd;t.texParameteri(h,Au,p),t.texParameteri(h,Tu,p),t.texParameteri(h,Cu,wu),t.texParameteri(h,Nu,wu)}}function t1(t,r,o,a,s,u){lb(t,r,{options:o,width:a,height:s,internalFormat:u})}function nl(t){return t.auto===!0||t.auto===void 0&&t.level===void 0}function ph(t,r){return r=r||{},r.cubeFaceOrder||[c0,MA,DA,OA,zA,BA]}function gh(t,r){const a=ph(t,r).map(function(s,u){return{face:s,ndx:u}});return a.sort(function(s,u){return s.face-u.face}),a}function Ru(t,r,o,a){a=a||Qr.textureOptions;const s=a.target||ur,u=a.level||0;let f=o.width,h=o.height;const p=a.internalFormat||a.format||nt,m=pl(p),y=a.format||m.format,g=a.type||m.type;if(t.bindTexture(s,r),s===cr){const x=o.width,_=o.height;let b,E;if(x/6===_)b=_,E=[0,0,1,0,2,0,3,0,4,0,5,0];else if(_/6===x)b=x,E=[0,0,0,1,0,2,0,3,0,4,0,5];else if(x/3===_/2)b=x/3,E=[0,0,1,0,2,0,0,1,1,1,2,1];else if(x/2===_/3)b=x/2,E=[0,0,1,0,0,1,1,1,0,2,1,2];else throw new Error(`can't figure out cube map from element: ${o.src?o.src:o.nodeName}`);const C=Kv();C?(C.canvas.width=b,C.canvas.height=b,f=b,h=b,Ir(t,a,()=>{gh(t,a).forEach(function(w){const D=E[w.ndx*2+0]*b,S=E[w.ndx*2+1]*b;C.drawImage(o,D,S,b,b,0,0,b,b),t.texImage2D(w.face,u,p,y,g,C.canvas)}),C.canvas.width=1,C.canvas.height=1})):typeof createImageBitmap<"u"&&(f=b,h=b,gh(t,a).forEach(function(w){const D=E[w.ndx*2+0]*b,S=E[w.ndx*2+1]*b;t.texImage2D(w.face,u,p,b,b,0,y,g,null),createImageBitmap(o,D,S,b,b,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then(function(N){Ir(t,a,()=>{t.bindTexture(s,r),t.texImage2D(w.face,u,p,y,g,N),nl(a)&&t1(t,r,a,f,h,p)})})}))}else s===Lo||s===Oo?Ir(t,a,()=>{const x=Math.min(o.width,o.height),_=Math.max(o.width,o.height),b=_/x;if(b%1!==0)throw new Error("can not compute 3D dimensions of element");const E=o.width===_?1:0,C=o.height===_?1:0;t.pixelStorei(f0,1),t.pixelStorei(Jv,o.width),t.pixelStorei(Wv,0),t.pixelStorei(nb,0),t.texImage3D(s,u,p,x,x,x,0,y,g,null);for(let w=0;w<b;++w){const D=w*x*E,S=w*x*C;t.pixelStorei(eb,D),t.pixelStorei(tb,S),t.texSubImage3D(s,u,0,0,w,x,x,1,y,g,o)}ib(t)}):Ir(t,a,()=>{t.texImage2D(s,u,p,y,g,o)});nl(a)&&t1(t,r,a,f,h,p),ab(t,r,a)}function gl(){}function QT(t){if(typeof document<"u"){const r=document.createElement("a");return r.href=t,r.hostname===location.hostname&&r.port===location.port&&r.protocol===location.protocol}else{const r=new URL(location.href).origin;return new URL(t,location.href).origin===r}}function KT(t,r){return r===void 0&&!QT(t)?"anonymous":r}function JT(t,r,o){o=o||gl;let a;if(r=r!==void 0?r:Qr.crossOrigin,r=KT(t,r),typeof Image<"u"){a=new Image,r!==void 0&&(a.crossOrigin=r);const s=function(){a.removeEventListener("error",u),a.removeEventListener("load",f),a=null},u=function(){const p="couldn't load image: "+t;Hv(p),o(p,a),s()},f=function(){o(null,a),s()};return a.addEventListener("error",u),a.addEventListener("load",f),a.src=t,a}else if(typeof ImageBitmap<"u"){let s,u;const f=function(){o(s,u)},h={};r&&(h.mode="cors"),fetch(t,h).then(function(p){if(!p.ok)throw p;return p.blob()}).then(function(p){return createImageBitmap(p,{premultiplyAlpha:"none",colorSpaceConversion:"none"})}).then(function(p){u=p,setTimeout(f)}).catch(function(p){s=p,setTimeout(f)}),a=null}return a}function sb(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof ImageData<"u"&&t instanceof ImageData||typeof HTMLElement<"u"&&t instanceof HTMLElement}function h0(t,r,o){return sb(t)?(setTimeout(function(){o(null,t)}),t):JT(t,r,o)}function m0(t,r,o){o=o||Qr.textureOptions;const a=o.target||ur;if(t.bindTexture(a,r),o.color===!1)return;const s=ZT(o.color);if(a===cr)for(let u=0;u<6;++u)t.texImage2D(c0+u,0,nt,1,1,0,nt,Ke,s);else a===Lo||a===Oo?t.texImage3D(a,0,nt,1,1,1,0,nt,Ke,s):t.texImage2D(a,0,nt,1,1,0,nt,Ke,s)}function WT(t,r,o,a){return a=a||gl,o=o||Qr.textureOptions,m0(t,r,o),o=d0(t,o),h0(o.src,o.crossOrigin,function(u,f){u?a(u,r,f):(Ru(t,r,f,o),a(null,r,f))})}function eC(t,r,o,a){a=a||gl;const s=o.src;if(s.length!==6)throw new Error("there must be 6 urls for a cubemap");const u=o.level||0,f=o.internalFormat||o.format||nt,h=pl(f),p=o.format||h.format,m=o.type||Ke,y=o.target||ur;if(y!==cr)throw new Error("target must be TEXTURE_CUBE_MAP");m0(t,r,o),o=d0(t,o);let g=6;const x=[],_=ph(t,o);let b;function E(C){return function(w,D){--g,w?x.push(w):D.width!==D.height?x.push("cubemap face img is not a square: "+D.src):Ir(t,o,()=>{t.bindTexture(y,r),g===5?ph().forEach(function(S){t.texImage2D(S,u,f,p,m,D)}):t.texImage2D(C,u,f,p,m,D),nl(o)&&t.generateMipmap(y)}),g===0&&a(x.length?x:void 0,r,b)}}b=s.map(function(C,w){return h0(C,o.crossOrigin,E(_[w]))})}function tC(t,r,o,a){a=a||gl;const s=o.src,u=o.internalFormat||o.format||nt,f=pl(u),h=o.format||f.format,p=o.type||Ke,m=o.target||Oo;if(m!==Lo&&m!==Oo)throw new Error("target must be TEXTURE_3D or TEXTURE_2D_ARRAY");m0(t,r,o),o=d0(t,o);let y=s.length;const g=[];let x;const _=o.level||0;let b=o.width,E=o.height;const C=s.length;let w=!0;function D(S){return function(N,O){--y,N?g.push(N):Ir(t,o,()=>{if(t.bindTexture(m,r),w){w=!1,b=o.width||O.width,E=o.height||O.height,t.texImage3D(m,_,u,b,E,C,0,h,p,null);for(let z=0;z<C;++z)t.texSubImage3D(m,_,0,0,z,b,E,1,h,p,O)}else{let z=O,B;(O.width!==b||O.height!==E)&&(B=Kv(),z=B.canvas,B.canvas.width=b,B.canvas.height=E,B.drawImage(O,0,0,b,E)),t.texSubImage3D(m,_,0,0,S,b,E,1,h,p,z),B&&z===B.canvas&&(B.canvas.width=0,B.canvas.height=0)}nl(o)&&t.generateMipmap(m)}),y===0&&a(g.length?g:void 0,r,x)}}x=s.map(function(S,N){return h0(S,o.crossOrigin,D(N))})}function yh(t,r,o,a){a=a||Qr.textureOptions;const s=a.target||ur;t.bindTexture(s,r);const u=a.level||0,f=a.internalFormat||a.format||nt,h=pl(f),p=a.format||h.format,m=a.type||PT(t,o,h.type);if(tl(o))o instanceof Uint8ClampedArray&&(o=new Uint8Array(o.buffer));else{const E=Uv(m);o=new E(o)}const{width:y,height:g,depth:x}=nC(s,o,a,f,p,m),_=ob(f);ib(t),t.pixelStorei(f0,a.unpackAlignment||1);let b=0;return Ir(t,a,()=>{let E=0;const{blockWidth:C,blockHeight:w,bytesPerBlock:D}=YT(f,m);for(;E<o.byteLength;){const S=Math.max(1,y>>b),N=Math.max(1,g>>b),O=s===ur?Math.max(1,x>>b):x,z=Math.ceil(S/C),B=Math.ceil(N/w),q=s===cr?6:1,I=z*B*D*O*q;if(E+I>o.byteLength)throw new Error("src size does not match number of mip levels");const ae=o.subarray(E/o.BYTES_PER_ELEMENT,(E+I)/o.BYTES_PER_ELEMENT),V=u+b;if(s===cr){const $=ae.length/6;gh(t,a).forEach(ee=>{const U=$*ee.ndx,X=ae.subarray(U,U+$);_?t.compressedTexImage2D(ee.face,V,f,S,N,0,X):t.texImage2D(ee.face,V,f,S,N,0,p,m,X)})}else s===Lo||s===Oo?t.texImage3D(s,V,f,S,N,O,0,p,m,ae):_?t.compressedTexImage2D(s,V,f,S,N,0,ae):t.texImage2D(s,V,f,S,N,0,p,m,ae);if(++b,E+=I,S===1&&N===1&&O===1&&E!==o.byteLength)throw new Error("src size has more data than can fit in mip levels")}}),{width:y,height:g,depth:x,type:m,lastMipLevelUploaded:u+b-1}}function nC(t,r,o,a,s,u){let f=o.width,h=o.height,p=o.depth;const m=ob(a);if(m){if(!f||!h)throw new Error("compressed texture needs to set width and height!");p=p||1}else{const y=rb(a,u),g=r.byteLength/y;if(g%1)throw new Error(`length wrong size for format: ${Qv(qa,s)}`);if(m&&(!f||!h))throw new Error("compressed texture needs to set width and height!");let x;if(t===Lo||t===Oo)if(!f&&!h&&!p){const _=Math.cbrt(g);if(_%1!==0)throw new Error(`can't guess cube size of array of numElements: ${g}`);f=_,h=_,p=_}else f&&(!h||!p)?(x=eu(qa,t,h,p,g/f),h=x.width,p=x.height):h&&(!f||!p)?(x=eu(qa,t,f,p,g/h),f=x.width,p=x.height):(x=eu(qa,t,f,h,g/p),f=x.width,h=x.height);else x=eu(qa,t,f,h,g),f=x.width,h=x.height}return{width:f,height:h,depth:p}}function rC(t,r,o){const a=o.target||ur;t.bindTexture(a,r);const s=o.level||0,u=o.internalFormat||o.format||nt,f=pl(u),h=o.format||f.format,p=o.type||f.type;Ir(t,o,()=>{if(a===cr)for(let m=0;m<6;++m)t.texImage2D(c0+m,s,u,o.width,o.height,0,h,p,null);else a===Lo||a===Oo?t.texImage3D(a,s,u,o.width,o.height,o.depth,0,h,p,null):t.texImage2D(a,s,u,o.width,o.height,0,h,p,null)})}function xh(t,r,o){o=o||gl,r=r||Qr.textureOptions;const a=t.createTexture(),s=r.target||ur;let u=r.width||1,f=r.height||1,h=0;const p=r.internalFormat||nt;t.bindTexture(s,a),s===cr&&(t.texParameteri(s,Cu,wu),t.texParameteri(s,Nu,wu));let m=r.src;if(m)if(typeof m=="function"&&(m=m(t,r)),typeof m=="string")WT(t,a,r,o);else if(tl(m)||Array.isArray(m)&&(typeof m[0]=="number"||Array.isArray(m[0])||tl(m[0]))){const y=yh(t,a,m,r);u=y.width,f=y.height,h=y.lastMipLevelUploaded}else Array.isArray(m)&&(typeof m[0]=="string"||sb(m[0]))?s===cr?eC(t,a,r,o):tC(t,a,r,o):(Ru(t,a,m,r),u=m.width,f=m.height);else rC(t,a,r);return nl(r)&&lb(t,a,{options:r,width:u,height:f,internalFormat:p,lastMipLevelUploaded:h}),ab(t,a,r),a}const p0=Hv;function ub(t){return typeof document<"u"&&document.getElementById?document.getElementById(t):null}const Mu=33984,Zu=34962,oC=34963,iC=35713,aC=35714,lC=35632,sC=35633,uC=35981,cb=35718,cC=35721,fC=35971,dC=35382,hC=35396,mC=35398,pC=35392,gC=35395,Qu=5126,fb=35664,db=35665,hb=35666,g0=5124,mb=35667,pb=35668,gb=35669,yb=35670,xb=35671,vb=35672,bb=35673,_b=35674,Eb=35675,Sb=35676,yC=35678,xC=35680,vC=35679,bC=35682,_C=35685,EC=35686,SC=35687,wC=35688,AC=35689,TC=35690,CC=36289,NC=36292,RC=36293,y0=5125,wb=36294,Ab=36295,Tb=36296,MC=36298,DC=36299,OC=36300,zC=36303,BC=36306,UC=36307,HC=36308,LC=36311,Ku=3553,Ju=34067,x0=32879,Wu=35866,Ae={};function Cb(t,r){return Ae[r].bindPoint}function jC(t,r){return function(o){t.uniform1f(r,o)}}function FC(t,r){return function(o){t.uniform1fv(r,o)}}function kC(t,r){return function(o){t.uniform2fv(r,o)}}function VC(t,r){return function(o){t.uniform3fv(r,o)}}function GC(t,r){return function(o){t.uniform4fv(r,o)}}function Nb(t,r){return function(o){t.uniform1i(r,o)}}function Rb(t,r){return function(o){t.uniform1iv(r,o)}}function Mb(t,r){return function(o){t.uniform2iv(r,o)}}function Db(t,r){return function(o){t.uniform3iv(r,o)}}function Ob(t,r){return function(o){t.uniform4iv(r,o)}}function qC(t,r){return function(o){t.uniform1ui(r,o)}}function XC(t,r){return function(o){t.uniform1uiv(r,o)}}function YC(t,r){return function(o){t.uniform2uiv(r,o)}}function IC(t,r){return function(o){t.uniform3uiv(r,o)}}function PC(t,r){return function(o){t.uniform4uiv(r,o)}}function $C(t,r){return function(o){t.uniformMatrix2fv(r,!1,o)}}function ZC(t,r){return function(o){t.uniformMatrix3fv(r,!1,o)}}function QC(t,r){return function(o){t.uniformMatrix4fv(r,!1,o)}}function KC(t,r){return function(o){t.uniformMatrix2x3fv(r,!1,o)}}function JC(t,r){return function(o){t.uniformMatrix3x2fv(r,!1,o)}}function WC(t,r){return function(o){t.uniformMatrix2x4fv(r,!1,o)}}function eN(t,r){return function(o){t.uniformMatrix4x2fv(r,!1,o)}}function tN(t,r){return function(o){t.uniformMatrix3x4fv(r,!1,o)}}function nN(t,r){return function(o){t.uniformMatrix4x3fv(r,!1,o)}}function Ot(t,r,o,a){const s=Cb(t,r);return ml(t)?function(u){let f,h;!u||Qh(t,u)?(f=u,h=null):(f=u.texture,h=u.sampler),t.uniform1i(a,o),t.activeTexture(Mu+o),t.bindTexture(s,f),t.bindSampler(o,h)}:function(u){t.uniform1i(a,o),t.activeTexture(Mu+o),t.bindTexture(s,u)}}function zt(t,r,o,a,s){const u=Cb(t,r),f=new Int32Array(s);for(let h=0;h<s;++h)f[h]=o+h;return ml(t)?function(h){t.uniform1iv(a,f),h.forEach(function(p,m){t.activeTexture(Mu+f[m]);let y,g;!p||Qh(t,p)?(y=p,g=null):(y=p.texture,g=p.sampler),t.bindSampler(o,g),t.bindTexture(u,y)})}:function(h){t.uniform1iv(a,f),h.forEach(function(p,m){t.activeTexture(Mu+f[m]),t.bindTexture(u,p)})}}Ae[Qu]={Type:Float32Array,size:4,setter:jC,arraySetter:FC};Ae[fb]={Type:Float32Array,size:8,setter:kC,cols:2};Ae[db]={Type:Float32Array,size:12,setter:VC,cols:3};Ae[hb]={Type:Float32Array,size:16,setter:GC,cols:4};Ae[g0]={Type:Int32Array,size:4,setter:Nb,arraySetter:Rb};Ae[mb]={Type:Int32Array,size:8,setter:Mb,cols:2};Ae[pb]={Type:Int32Array,size:12,setter:Db,cols:3};Ae[gb]={Type:Int32Array,size:16,setter:Ob,cols:4};Ae[y0]={Type:Uint32Array,size:4,setter:qC,arraySetter:XC};Ae[wb]={Type:Uint32Array,size:8,setter:YC,cols:2};Ae[Ab]={Type:Uint32Array,size:12,setter:IC,cols:3};Ae[Tb]={Type:Uint32Array,size:16,setter:PC,cols:4};Ae[yb]={Type:Uint32Array,size:4,setter:Nb,arraySetter:Rb};Ae[xb]={Type:Uint32Array,size:8,setter:Mb,cols:2};Ae[vb]={Type:Uint32Array,size:12,setter:Db,cols:3};Ae[bb]={Type:Uint32Array,size:16,setter:Ob,cols:4};Ae[_b]={Type:Float32Array,size:32,setter:$C,rows:2,cols:2};Ae[Eb]={Type:Float32Array,size:48,setter:ZC,rows:3,cols:3};Ae[Sb]={Type:Float32Array,size:64,setter:QC,rows:4,cols:4};Ae[_C]={Type:Float32Array,size:32,setter:KC,rows:2,cols:3};Ae[EC]={Type:Float32Array,size:32,setter:WC,rows:2,cols:4};Ae[SC]={Type:Float32Array,size:48,setter:JC,rows:3,cols:2};Ae[wC]={Type:Float32Array,size:48,setter:tN,rows:3,cols:4};Ae[AC]={Type:Float32Array,size:64,setter:eN,rows:4,cols:2};Ae[TC]={Type:Float32Array,size:64,setter:nN,rows:4,cols:3};Ae[yC]={Type:null,size:0,setter:Ot,arraySetter:zt,bindPoint:Ku};Ae[xC]={Type:null,size:0,setter:Ot,arraySetter:zt,bindPoint:Ju};Ae[vC]={Type:null,size:0,setter:Ot,arraySetter:zt,bindPoint:x0};Ae[bC]={Type:null,size:0,setter:Ot,arraySetter:zt,bindPoint:Ku};Ae[CC]={Type:null,size:0,setter:Ot,arraySetter:zt,bindPoint:Wu};Ae[NC]={Type:null,size:0,setter:Ot,arraySetter:zt,bindPoint:Wu};Ae[RC]={Type:null,size:0,setter:Ot,arraySetter:zt,bindPoint:Ju};Ae[MC]={Type:null,size:0,setter:Ot,arraySetter:zt,bindPoint:Ku};Ae[DC]={Type:null,size:0,setter:Ot,arraySetter:zt,bindPoint:x0};Ae[OC]={Type:null,size:0,setter:Ot,arraySetter:zt,bindPoint:Ju};Ae[zC]={Type:null,size:0,setter:Ot,arraySetter:zt,bindPoint:Wu};Ae[BC]={Type:null,size:0,setter:Ot,arraySetter:zt,bindPoint:Ku};Ae[UC]={Type:null,size:0,setter:Ot,arraySetter:zt,bindPoint:x0};Ae[HC]={Type:null,size:0,setter:Ot,arraySetter:zt,bindPoint:Ju};Ae[LC]={Type:null,size:0,setter:Ot,arraySetter:zt,bindPoint:Wu};function ec(t,r){return function(o){if(o.value)switch(t.disableVertexAttribArray(r),o.value.length){case 4:t.vertexAttrib4fv(r,o.value);break;case 3:t.vertexAttrib3fv(r,o.value);break;case 2:t.vertexAttrib2fv(r,o.value);break;case 1:t.vertexAttrib1fv(r,o.value);break;default:throw new Error("the length of a float constant value must be between 1 and 4!")}else t.bindBuffer(Zu,o.buffer),t.enableVertexAttribArray(r),t.vertexAttribPointer(r,o.numComponents||o.size,o.type||Qu,o.normalize||!1,o.stride||0,o.offset||0),t.vertexAttribDivisor&&t.vertexAttribDivisor(r,o.divisor||0)}}function Kr(t,r){return function(o){if(o.value)if(t.disableVertexAttribArray(r),o.value.length===4)t.vertexAttrib4iv(r,o.value);else throw new Error("The length of an integer constant value must be 4!");else t.bindBuffer(Zu,o.buffer),t.enableVertexAttribArray(r),t.vertexAttribIPointer(r,o.numComponents||o.size,o.type||g0,o.stride||0,o.offset||0),t.vertexAttribDivisor&&t.vertexAttribDivisor(r,o.divisor||0)}}function tc(t,r){return function(o){if(o.value)if(t.disableVertexAttribArray(r),o.value.length===4)t.vertexAttrib4uiv(r,o.value);else throw new Error("The length of an unsigned integer constant value must be 4!");else t.bindBuffer(Zu,o.buffer),t.enableVertexAttribArray(r),t.vertexAttribIPointer(r,o.numComponents||o.size,o.type||y0,o.stride||0,o.offset||0),t.vertexAttribDivisor&&t.vertexAttribDivisor(r,o.divisor||0)}}function v0(t,r,o){const a=o.size,s=o.count;return function(u){t.bindBuffer(Zu,u.buffer);const f=u.size||u.numComponents||a,h=f/s,p=u.type||Qu,y=Ae[p].size*f,g=u.normalize||!1,x=u.offset||0,_=y/s;for(let b=0;b<s;++b)t.enableVertexAttribArray(r+b),t.vertexAttribPointer(r+b,h,p,g,y,x+_*b),t.vertexAttribDivisor&&t.vertexAttribDivisor(r+b,u.divisor||0)}}const pt={};pt[Qu]={size:4,setter:ec};pt[fb]={size:8,setter:ec};pt[db]={size:12,setter:ec};pt[hb]={size:16,setter:ec};pt[g0]={size:4,setter:Kr};pt[mb]={size:8,setter:Kr};pt[pb]={size:12,setter:Kr};pt[gb]={size:16,setter:Kr};pt[y0]={size:4,setter:tc};pt[wb]={size:8,setter:tc};pt[Ab]={size:12,setter:tc};pt[Tb]={size:16,setter:tc};pt[yb]={size:4,setter:Kr};pt[xb]={size:8,setter:Kr};pt[vb]={size:12,setter:Kr};pt[bb]={size:16,setter:Kr};pt[_b]={size:4,setter:v0,count:2};pt[Eb]={size:9,setter:v0,count:3};pt[Sb]={size:16,setter:v0,count:4};const rN=/ERROR:\s*\d+:(\d+)/gi;function oN(t,r="",o=0){const a=[...r.matchAll(rN)],s=new Map(a.map((u,f)=>{const h=parseInt(u[1]),p=a[f+1],m=p?p.index:r.length,y=r.substring(u.index,m);return[h-1,y]}));return t.split(`
|
|
840
|
+
`).map((u,f)=>{const h=s.get(f);return`${f+1+o}: ${u}${h?`
|
|
841
|
+
|
|
842
|
+
^^^ ${h}`:""}`}).join(`
|
|
843
|
+
`)}const n1=/^[ \t]*\n/;function zb(t){let r=0;return n1.test(t)&&(r=1,t=t.replace(n1,"")),{lineOffset:r,shaderSource:t}}function iN(t,r){return t.errorCallback(r),t.callback&&setTimeout(()=>{t.callback(`${r}
|
|
844
|
+
${t.errors.join(`
|
|
845
|
+
`)}`)}),null}function aN(t,r,o,a){if(a=a||p0,!t.getShaderParameter(o,iC)){const u=t.getShaderInfoLog(o),{lineOffset:f,shaderSource:h}=zb(t.getShaderSource(o)),p=`${oN(h,u,f)}
|
|
846
|
+
Error compiling ${Qv(t,r)}: ${u}`;return a(p),p}return""}function b0(t,r,o){let a,s,u;if(typeof r=="function"&&(o=r,r=void 0),typeof t=="function")o=t,t=void 0;else if(t&&!Array.isArray(t)){const m=t;o=m.errorCallback,t=m.attribLocations,a=m.transformFeedbackVaryings,s=m.transformFeedbackMode,u=m.callback}const f=o||p0,h=[],p={errorCallback(m,...y){h.push(m),f(m,...y)},transformFeedbackVaryings:a,transformFeedbackMode:s,callback:u,errors:h};{let m={};Array.isArray(t)?t.forEach(function(y,g){m[y]=r?r[g]:g}):m=t||{},p.attribLocations=m}return p}const lN=["VERTEX_SHADER","FRAGMENT_SHADER"];function sN(t,r){if(r.indexOf("frag")>=0)return lC;if(r.indexOf("vert")>=0)return sC}function uN(t,r,o){const a=t.getAttachedShaders(r);for(const s of a)o.has(s)||t.deleteShader(s);t.deleteProgram(r)}const cN=(t=0)=>new Promise(r=>setTimeout(r,t));function fN(t,r,o){const a=t.createProgram(),{attribLocations:s,transformFeedbackVaryings:u,transformFeedbackMode:f}=b0(o);for(let h=0;h<r.length;++h){let p=r[h];if(typeof p=="string"){const m=ub(p),y=m?m.text:p;let g=t[lN[h]];m&&m.type&&(g=sN(t,m.type)||g),p=t.createShader(g),t.shaderSource(p,zb(y).shaderSource),t.compileShader(p)}t.attachShader(a,p)}Object.entries(s).forEach(([h,p])=>t.bindAttribLocation(a,p,h));{let h=u;h&&(h.attribs&&(h=h.attribs),Array.isArray(h)||(h=Object.keys(h)),t.transformFeedbackVaryings(a,h,f||uC))}return t.linkProgram(a),a}function dN(t,r,o,a,s){const u=b0(o,a,s),f=new Set(r),h=fN(t,r,u);function p(m,y){const g=mN(m,y,u.errorCallback);return g&&uN(m,y,f),g}if(u.callback){hN(t,h).then(()=>{const m=p(t,h);u.callback(m,m?void 0:h)});return}return p(t,h)?void 0:h}async function hN(t,r){const o=t.getExtension("KHR_parallel_shader_compile"),a=o?(u,f)=>u.getProgramParameter(f,o.COMPLETION_STATUS_KHR):()=>!0;let s=0;do await cN(s),s=1e3/60;while(!a(t,r))}function mN(t,r,o){if(o=o||p0,!t.getProgramParameter(r,aC)){const s=t.getProgramInfoLog(r);o(`Error in program linking: ${s}`);const f=t.getAttachedShaders(r).map(h=>aN(t,t.getShaderParameter(h,t.SHADER_TYPE),h,o));return`${s}
|
|
847
|
+
${f.filter(h=>h).join(`
|
|
848
|
+
`)}`}}function pN(t,r,o,a,s){return dN(t,r,o,a,s)}function Bb(t){const r=t.name;return r.startsWith("gl_")||r.startsWith("webgl_")}const gN=/(\.|\[|]|\w+)/g,yN=t=>t>="0"&&t<="9";function xN(t,r,o,a){const s=t.split(gN).filter(h=>h!=="");let u=0,f="";for(;;){const h=s[u++];f+=h;const p=yN(h[0]),m=p?parseInt(h):h;if(p&&(f+=s[u++]),u===s.length){o[m]=r;break}else{const g=s[u++],x=g==="[",_=o[m]||(x?[]:{});o[m]=_,o=_,a[f]=a[f]||(function(b){return function(E){Ub(b,E)}})(_),f+=g}}}function vN(t,r){let o=0;function a(h,p,m){const y=p.name.endsWith("[0]"),g=p.type,x=Ae[g];if(!x)throw new Error(`unknown type: 0x${g.toString(16)}`);let _;if(x.bindPoint){const b=o;o+=p.size,y?_=x.arraySetter(t,g,b,m,p.size):_=x.setter(t,g,b,m,p.size)}else x.arraySetter&&y?_=x.arraySetter(t,m):_=x.setter(t,m);return _.location=m,_}const s={},u={},f=t.getProgramParameter(r,cb);for(let h=0;h<f;++h){const p=t.getActiveUniform(r,h);if(Bb(p))continue;let m=p.name;m.endsWith("[0]")&&(m=m.substr(0,m.length-3));const y=t.getUniformLocation(r,p.name);if(y){const g=a(r,p,y);s[m]=g,xN(m,g,u,s)}}return s}function bN(t,r){const o={},a=t.getProgramParameter(r,fC);for(let s=0;s<a;++s){const u=t.getTransformFeedbackVarying(r,s);o[u.name]={index:s,type:u.type,size:u.size}}return o}function _N(t,r){const o=t.getProgramParameter(r,cb),a=[],s=[];for(let h=0;h<o;++h){s.push(h),a.push({});const p=t.getActiveUniform(r,h);a[h].name=p.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach(function(h){const p=h[0],m=h[1];t.getActiveUniforms(r,s,t[p]).forEach(function(y,g){a[g][m]=y})});const u={},f=t.getProgramParameter(r,dC);for(let h=0;h<f;++h){const p=t.getActiveUniformBlockName(r,h),m={index:t.getUniformBlockIndex(r,p),usedByVertexShader:t.getActiveUniformBlockParameter(r,h,hC),usedByFragmentShader:t.getActiveUniformBlockParameter(r,h,mC),size:t.getActiveUniformBlockParameter(r,h,pC),uniformIndices:t.getActiveUniformBlockParameter(r,h,gC)};m.used=m.usedByVertexShader||m.usedByFragmentShader,u[p]=m}return{blockSpecs:u,uniformData:a}}function Ub(t,r){for(const o in r){const a=t[o];typeof a=="function"?a(r[o]):Ub(t[o],r[o])}}function Hb(t,...r){const o=t.uniformSetters||t,a=r.length;for(let s=0;s<a;++s){const u=r[s];if(Array.isArray(u)){const f=u.length;for(let h=0;h<f;++h)Hb(o,u[h])}else for(const f in u){const h=o[f];h&&h(u[f])}}}function EN(t,r){const o={},a=t.getProgramParameter(r,cC);for(let s=0;s<a;++s){const u=t.getActiveAttrib(r,s);if(Bb(u))continue;const f=t.getAttribLocation(r,u.name),h=pt[u.type],p=h.setter(t,f,h);p.location=f,o[u.name]=p}return o}function SN(t,r){for(const o in r){const a=t[o];a&&a(r[o])}}function wN(t,r,o){o.vertexArrayObject?t.bindVertexArray(o.vertexArrayObject):(SN(r.attribSetters||r,o.attribs),o.indices&&t.bindBuffer(oC,o.indices))}function r1(t,r){const o=vN(t,r),a=EN(t,r),s={program:r,uniformSetters:o,attribSetters:a,uniformLocations:Object.fromEntries(Object.entries(o).map(([u,f])=>[u,f.location])),attribLocations:Object.fromEntries(Object.entries(a).map(([u,f])=>[u,f.location]))};return ml(t)&&(s.uniformBlockSpec=_N(t,r),s.transformFeedbackInfo=bN(t,r)),s}const AN=/\s|{|}|;/;function TN(t,r,o,a,s){const u=b0(o,a,s),f=[];if(r=r.map(function(m){if(!AN.test(m)){const y=ub(m);if(y)m=y.text;else{const g=`no element with id: ${m}`;u.errorCallback(g),f.push(g)}}return m}),f.length)return iN(u,"");const h=u.callback;h&&(u.callback=(m,y)=>{h(m,m?void 0:r1(t,y))});const p=pN(t,r,u);return p?r1(t,p):null}const CN=4,o1=5123;function NN(t,r,o,a,s,u){o=o===void 0?CN:o;const f=r.indices,h=r.elementType,p=a===void 0?r.numElements:a;s=s===void 0?0:s,h||f?u!==void 0?t.drawElementsInstanced(o,p,h===void 0?o1:r.elementType,s,u):t.drawElements(o,p,h===void 0?o1:r.elementType,s):u!==void 0?t.drawArraysInstanced(o,s,p,u):t.drawArrays(o,s,p)}const Lb=36160,tu=36161,RN=3553,MN=5121,DN=6402,ON=6408,zN=33190,BN=36012,UN=35056,HN=36013,LN=32854,jN=32855,FN=36194,jb=33189,Fb=6401,kb=36168,_0=34041,vh=36064,nc=36096,Vb=36128,E0=33306,bh=33071,_h=9729,kN=[{format:ON,type:MN,min:_h,wrap:bh},{format:_0}],_n={};_n[_0]=E0;_n[Fb]=Vb;_n[kb]=Vb;_n[DN]=nc;_n[jb]=nc;_n[zN]=nc;_n[BN]=nc;_n[UN]=E0;_n[HN]=E0;function VN(t,r){return _n[t]||_n[r]}const Jr={};Jr[LN]=!0;Jr[jN]=!0;Jr[FN]=!0;Jr[_0]=!0;Jr[jb]=!0;Jr[Fb]=!0;Jr[kb]=!0;function GN(t){return Jr[t]}const qN=32;function XN(t){return t>=vh&&t<vh+qN}function YN(t,r,o,a){const s=Lb,u=t.createFramebuffer();t.bindFramebuffer(s,u),o=o||t.drawingBufferWidth,a=a||t.drawingBufferHeight,r=r||kN;const f=[],h={framebuffer:u,attachments:[],width:o,height:a};return r.forEach(function(p,m){let y=p.attachment;const g=p.samples,x=p.format;let _=p.attachmentPoint||VN(x,p.internalFormat);if(_||(_=vh+m),XN(_)&&f.push(_),!y)if(g!==void 0||GN(x))y=t.createRenderbuffer(),t.bindRenderbuffer(tu,y),g>1?t.renderbufferStorageMultisample(tu,g,x,o,a):t.renderbufferStorage(tu,x,o,a);else{const b=Object.assign({},p);b.width=o,b.height=a,b.auto===void 0&&(b.auto=!1,b.min=b.min||b.minMag||_h,b.mag=b.mag||b.minMag||_h,b.wrapS=b.wrapS||b.wrap||bh,b.wrapT=b.wrapT||b.wrap||bh),y=xh(t,b)}if(A3(t,y))t.framebufferRenderbuffer(s,_,tu,y);else if(Qh(t,y))p.layer!==void 0?t.framebufferTextureLayer(s,_,y,p.level||0,p.layer):t.framebufferTexture2D(s,_,p.target||RN,y,p.level||0);else throw new Error("unknown attachment type");h.attachments.push(y)}),t.drawBuffers&&t.drawBuffers(f),h}function i1(t,r,o){o=o||Lb,r?(t.bindFramebuffer(o,r.framebuffer),t.viewport(0,0,r.width,r.height)):(t.bindFramebuffer(o,null),t.viewport(0,0,t.drawingBufferWidth,t.drawingBufferHeight))}const a1=t=>{const r=t.replace("#","");return[parseInt(r.substring(0,2),16),parseInt(r.substring(2,4),16),parseInt(r.substring(4,6),16)]},IN=(t,r,o)=>{const[a,s,u]=a1(t),[f,h,p]=a1(r),m=Math.round(a+(f-a)*o).toString(16).padStart(2,"0"),y=Math.round(s+(h-s)*o).toString(16).padStart(2,"0"),g=Math.round(u+(p-u)*o).toString(16).padStart(2,"0");return`#${m}${y}${g}`},Gb=(t,r)=>{const o=Math.max(0,Math.min(1,r)),a=[...t].sort((p,m)=>p.position-m.position);if(a.length===0)return"#000000";if(a.length===1||o<=a[0].position)return a[0].color;if(o>=a[a.length-1].position)return a[a.length-1].color;let s=a[0],u=a[a.length-1];for(let p=0;p<a.length-1;p++)if(o>=a[p].position&&o<=a[p+1].position){s=a[p],u=a[p+1];break}const f=u.position-s.position,h=f===0?0:(o-s.position)/f;return IN(s.color,u.color,h)},PN=t=>typeof t=="object"&&t!==null&&t.type==="texture"&&"src"in t,$N=t=>typeof t=="object"&&t!==null&&t.type==="gradient",ZN=`#version 300 es
|
|
849
|
+
|
|
850
|
+
precision highp float;
|
|
851
|
+
|
|
852
|
+
in vec2 position;
|
|
853
|
+
in vec2 texcoord;
|
|
854
|
+
|
|
855
|
+
out vec2 vUv;
|
|
856
|
+
|
|
857
|
+
void main() {
|
|
858
|
+
vUv = vec2(texcoord.x, texcoord.y);
|
|
859
|
+
gl_Position = vec4(position, 0.0, 1.0);
|
|
860
|
+
}
|
|
861
|
+
`;class QN{programs={};fbos={};renderOrder=[];dependencyMapping={};quad;textures={};textureSrcs={};gradientCanvases={};defaultTexture;patch;gl;uniforms;onTextureLoaded;error=null;constructor(r,o){this.patch=o,this.gl=r,this.defaultTexture=xh(this.gl,{minMag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1}),yh(this.gl,this.defaultTexture,new Uint8Array([0,0,0,255]),{width:1,height:1,minMag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1});let a=!1;for(let h=0;h<o.shaders.length&&!a;h++){const p=o.shaders[h];if(this.programs[p.id]=TN(this.gl,[ZN,p.source],void 0,m=>{const y=m.match(/ERROR:\s*\d+:(\d+):/),g=y?parseInt(y[1],10):0;this.error={message:m,line:g,shaderName:p.name},a=!0}),a)break;this.fbos[p.id]=YN(this.gl,[{format:this.gl.RGBA,min:this.gl.NEAREST,mag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1}],p.resolution.width,p.resolution.height)}this.quad=NA.createXYQuadBufferInfo(this.gl);const s={},u={};this.uniforms={};for(let h=0;h<this.patch.shaders.length;h++){const p=this.patch.shaders[h];s[p.id]=[],u[p.id]=0,this.dependencyMapping[p.id]=[],this.uniforms[p.id]={}}for(const h of this.patch.connections)s[h.from].push(h.to),u[h.to]+=1,this.dependencyMapping[h.to].push({input:h.input,from:h.from});const f=[...Object.entries(u)].reduce((h,[p,m])=>m===0?[...h,p]:h,[]);for(;f.length>0;){const h=f.shift();this.renderOrder.push(h);for(const p of s[h]){const m=u[p]-1;u[p]=m,m===0&&f.push(p)}}if(this.renderOrder.length<this.patch.shaders.length)throw console.log(this.patch,this.renderOrder),Error("Cycle detected in graph")}_getOrCreateTexture(r){if(!this.textures[r]){const o=xh(this.gl,{minMag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1});yh(this.gl,o,new Uint8Array([0,0,0,255]),{width:1,height:1,minMag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1}),this.textures[r]=o}return this.textures[r]}_updateGradientUniform(r,o){let a=this.gradientCanvases[r];a||(a=document.createElement("canvas"),a.width=256,a.height=1,this.gradientCanvases[r]=a);const s=a.getContext("2d");for(let u=0;u<256;u++)s.fillStyle=Gb(o.stops,u/255),s.fillRect(u,0,1,1);return this._updateTextureUniform(r,{type:"texture",src:a})}_updateTextureUniform(r,o){const a=this._getOrCreateTexture(r),s=o.src;if(typeof s=="string"){if(this.textureSrcs[r]!==s){this.textureSrcs[r]=s;const u=new Image;u.onload=()=>{this.textures[r]===a&&(Ru(this.gl,a,u,{minMag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1}),this.onTextureLoaded?.())},u.src=s}}else Ru(this.gl,a,s,{minMag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1});return a}render(){if(!this.error)for(let r=0;r<this.renderOrder.length;r++){const o=this.renderOrder[r],a=this.programs[o],s={...this.uniforms[o]};for(const[u,f]of Object.entries(s))PN(f)?s[u]=this._updateTextureUniform(`${o}::${u}`,f):$N(f)&&(s[u]=this._updateGradientUniform(`${o}::${u}`,f));for(const u of this.dependencyMapping[o])s[u.input]=this.fbos[u.from].attachments[0];this.gl.useProgram(a.program),r!==this.renderOrder.length-1?i1(this.gl,this.fbos[o]):i1(this.gl,null),Hb(a,s),wN(this.gl,a,this.quad),NN(this.gl,this.quad)}}dispose(){for(const r of Object.values(this.programs))r&&r.program&&this.gl.deleteProgram(r.program);this.programs={};for(const r of Object.values(this.fbos)){for(const o of r.attachments)o instanceof WebGLTexture?this.gl.deleteTexture(o):o instanceof WebGLRenderbuffer&&this.gl.deleteRenderbuffer(o);this.gl.deleteFramebuffer(r.framebuffer)}this.fbos={};for(const r of Object.values(this.textures))this.gl.deleteTexture(r);this.textures={},this.textureSrcs={},this.gradientCanvases={},this.gl.deleteTexture(this.defaultTexture),this.quad.indices&&this.gl.deleteBuffer(this.quad.indices);for(const r of Object.values(this.quad.attribs??{}))r.buffer&&this.gl.deleteBuffer(r.buffer)}}const qb=j.forwardRef(({patch:t,uniforms:r,className:o,style:a,width:s=100,height:u=100,animate:f,onError:h},p)=>{const m=j.useRef(null);return j.useEffect(()=>{if(m.current){const y=m.current.getContext("webgl2",{preserveDrawingBuffer:!0}),g=new QN(y,t);h?.(g.error);let x=null;const _=()=>{g.uniforms=r.current,g.render()};return f?x=requestAnimationFrame(function b(){_(),x=requestAnimationFrame(b)}):(g.onTextureLoaded=_,_()),()=>{x!==null&&cancelAnimationFrame(x),g.dispose()}}},[t,s,u,f]),A.jsx("canvas",{className:`image-crisp ${o??""}`,style:a,width:s,height:u,ref:y=>{m.current=y,typeof p=="function"?p(y):p&&(p.current=y)}})}),vt="([-\\d.]+)",Qt="\\s*,\\s*",Ui=t=>{const r=[],o=t.source.split(`
|
|
862
|
+
`);for(const a of o){const s=a.trim(),u=s.match(new RegExp(`^uniform\\s+float\\s+(\\w+)\\s*;.*\\/\\/\\s*\\[\\s*${vt}${Qt}${vt}${Qt}${vt}\\s*\\]`));if(u?.[1]){const w=parseFloat(u[2]),D=parseFloat(u[3]),S=parseFloat(u[4]);r.push({name:u[1],type:"float",min:w,max:D,default:S});continue}const f=s.match(/^uniform\s+float\s+(\w+)\s*;.*\/\/\s*time\b/);if(f?.[1]){r.push({name:f[1],type:"float",special:"time"});continue}const h=s.match(/^uniform\s+float\s+(\w+)\s*;/);if(h?.[1]){r.push({name:h[1],type:"float"});continue}const p=s.match(new RegExp(`^uniform\\s+vec2\\s+(\\w+)\\s*;.*\\/\\/\\s*\\[\\s*${vt}${Qt}${vt}\\s*\\]`));if(p?.[1]){const w=[parseFloat(p[2]),parseFloat(p[3])];r.push({name:p[1],type:"vec2",default:w});continue}const m=s.match(new RegExp(`^uniform\\s+vec3\\s+(\\w+)\\s*;.*\\/\\/\\s*color(?:\\s*\\[\\s*${vt}${Qt}${vt}${Qt}${vt}\\s*\\])?`));if(m?.[1]){const w=m[2]!==void 0?[parseFloat(m[2]),parseFloat(m[3]),parseFloat(m[4])]:void 0;r.push({name:m[1],type:"vec3",color:!0,...w&&{default:w}});continue}const y=s.match(new RegExp(`^uniform\\s+vec3\\s+(\\w+)\\s*;.*\\/\\/\\s*\\[\\s*${vt}${Qt}${vt}${Qt}${vt}\\s*\\]`));if(y?.[1]){const w=[parseFloat(y[2]),parseFloat(y[3]),parseFloat(y[4])];r.push({name:y[1],type:"vec3",default:w});continue}const g=s.match(new RegExp(`^uniform\\s+vec4\\s+(\\w+)\\s*;.*\\/\\/\\s*color(?:\\s*\\[\\s*${vt}${Qt}${vt}${Qt}${vt}${Qt}${vt}\\s*\\])?`));if(g?.[1]){const w=g[2]!==void 0?[parseFloat(g[2]),parseFloat(g[3]),parseFloat(g[4]),parseFloat(g[5])]:void 0;r.push({name:g[1],type:"vec4",color:!0,...w&&{default:w}});continue}const x=s.match(new RegExp(`^uniform\\s+vec4\\s+(\\w+)\\s*;.*\\/\\/\\s*\\[\\s*${vt}${Qt}${vt}${Qt}${vt}${Qt}${vt}\\s*\\]`));if(x?.[1]){const w=[parseFloat(x[2]),parseFloat(x[3]),parseFloat(x[4]),parseFloat(x[5])];r.push({name:x[1],type:"vec4",default:w});continue}const _=s.match(/^uniform\s+vec2\s+(\w+)\s*;.*\/\/\s*mouse\b/);if(_?.[1]){r.push({name:_[1],type:"vec2",special:"mouse"});continue}const b=s.match(/^uniform\s+vec2\s+(\w+)\s*;.*\/\/\s*resolution\b/);if(b?.[1]){r.push({name:b[1],type:"vec2",special:"resolution"});continue}const E=s.match(/^uniform\s+(vec[234])\s+(\w+)\s*;/);if(E){const w=E[1],D=E[2];w==="vec2"?r.push({name:D,type:"vec2"}):w==="vec3"?r.push({name:D,type:"vec3"}):w==="vec4"&&r.push({name:D,type:"vec4"});continue}const C=s.match(/^uniform\s+sampler2D\s+(\w+)\s*;(?:.*\/\/\s*(texture|gradient)\b)?/);if(C?.[1]){const w=C[2],D=w==="texture"?"texture":w==="gradient"?"gradient":"input";r.push({name:C[1],type:"sampler2D",source:D})}}return r};function KN(t,r){switch(r.type){case"float":return typeof t=="number";case"vec2":return Array.isArray(t)&&t.length===2;case"vec3":return Array.isArray(t)&&t.length===3;case"vec4":return Array.isArray(t)&&t.length===4;case"sampler2D":return r.source==="gradient"?t?.type==="gradient":r.source==="texture"?t?.type==="texture":!1}}function Xb(t){switch(t.type){case"float":return t.default??0;case"vec2":return t.default??[0,0];case"vec3":return t.default??(t.color?[1,1,1]:[0,0,0]);case"vec4":return t.default??(t.color?[1,1,1,1]:[0,0,0,0]);case"sampler2D":return}}const JN=`import { RendererComponent, type Uniforms, type Patch } from "@sequenza/lib";
|
|
863
|
+
import "@sequenza/lib/style.css";
|
|
864
|
+
import { useRef } from "react";
|
|
865
|
+
|
|
866
|
+
function SequenzaComponent() {
|
|
867
|
+
const uniformRef = useRef<Record<string, Uniforms>>(getInitialUniforms());
|
|
868
|
+
|
|
869
|
+
return (
|
|
870
|
+
<RendererComponent
|
|
871
|
+
patch={getPatch()}
|
|
872
|
+
uniforms={uniformRef}
|
|
873
|
+
animate={true}
|
|
874
|
+
width={100}
|
|
875
|
+
height={100}
|
|
876
|
+
></RendererComponent>
|
|
877
|
+
);
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
export default SequenzaComponent;
|
|
881
|
+
|
|
882
|
+
function getInitialUniforms(): Record<string, Uniforms> {
|
|
883
|
+
throw new Error("placeholder for initial uniforms");
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
function getPatch(): Patch {
|
|
887
|
+
throw new Error("placeholder for patch");
|
|
888
|
+
}
|
|
889
|
+
`;function WN(t,r){let o=JN;const a=Object.keys(t).filter(u=>!!r.shaders.find(h=>h.id===u)),s={};for(const u of a)s[u]=t[u];return o=o.replace('throw new Error("placeholder for initial uniforms");',`return ${JSON.stringify(s,null,2)};`),o=o.replace('throw new Error("placeholder for patch");',`return ${JSON.stringify(r,null,2)};`),o}function gt(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let o=0,a;o<t.length;o++)(a=gt(t[o]))!==""&&(r+=(r&&" ")+a);else for(let o in t)t[o]&&(r+=(r&&" ")+o);return r}var eR={value:()=>{}};function rc(){for(var t=0,r=arguments.length,o={},a;t<r;++t){if(!(a=arguments[t]+"")||a in o||/[\s.]/.test(a))throw new Error("illegal type: "+a);o[a]=[]}return new vu(o)}function vu(t){this._=t}function tR(t,r){return t.trim().split(/^|\s+/).map(function(o){var a="",s=o.indexOf(".");if(s>=0&&(a=o.slice(s+1),o=o.slice(0,s)),o&&!r.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:a}})}vu.prototype=rc.prototype={constructor:vu,on:function(t,r){var o=this._,a=tR(t+"",o),s,u=-1,f=a.length;if(arguments.length<2){for(;++u<f;)if((s=(t=a[u]).type)&&(s=nR(o[s],t.name)))return s;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++u<f;)if(s=(t=a[u]).type)o[s]=l1(o[s],t.name,r);else if(r==null)for(s in o)o[s]=l1(o[s],t.name,null);return this},copy:function(){var t={},r=this._;for(var o in r)t[o]=r[o].slice();return new vu(t)},call:function(t,r){if((s=arguments.length-2)>0)for(var o=new Array(s),a=0,s,u;a<s;++a)o[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(u=this._[t],a=0,s=u.length;a<s;++a)u[a].value.apply(r,o)},apply:function(t,r,o){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var a=this._[t],s=0,u=a.length;s<u;++s)a[s].value.apply(r,o)}};function nR(t,r){for(var o=0,a=t.length,s;o<a;++o)if((s=t[o]).name===r)return s.value}function l1(t,r,o){for(var a=0,s=t.length;a<s;++a)if(t[a].name===r){t[a]=eR,t=t.slice(0,a).concat(t.slice(a+1));break}return o!=null&&t.push({name:r,value:o}),t}var Eh="http://www.w3.org/1999/xhtml";const s1={svg:"http://www.w3.org/2000/svg",xhtml:Eh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function oc(t){var r=t+="",o=r.indexOf(":");return o>=0&&(r=t.slice(0,o))!=="xmlns"&&(t=t.slice(o+1)),s1.hasOwnProperty(r)?{space:s1[r],local:t}:t}function rR(t){return function(){var r=this.ownerDocument,o=this.namespaceURI;return o===Eh&&r.documentElement.namespaceURI===Eh?r.createElement(t):r.createElementNS(o,t)}}function oR(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Yb(t){var r=oc(t);return(r.local?oR:rR)(r)}function iR(){}function S0(t){return t==null?iR:function(){return this.querySelector(t)}}function aR(t){typeof t!="function"&&(t=S0(t));for(var r=this._groups,o=r.length,a=new Array(o),s=0;s<o;++s)for(var u=r[s],f=u.length,h=a[s]=new Array(f),p,m,y=0;y<f;++y)(p=u[y])&&(m=t.call(p,p.__data__,y,u))&&("__data__"in p&&(m.__data__=p.__data__),h[y]=m);return new Jt(a,this._parents)}function lR(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function sR(){return[]}function Ib(t){return t==null?sR:function(){return this.querySelectorAll(t)}}function uR(t){return function(){return lR(t.apply(this,arguments))}}function cR(t){typeof t=="function"?t=uR(t):t=Ib(t);for(var r=this._groups,o=r.length,a=[],s=[],u=0;u<o;++u)for(var f=r[u],h=f.length,p,m=0;m<h;++m)(p=f[m])&&(a.push(t.call(p,p.__data__,m,f)),s.push(p));return new Jt(a,s)}function Pb(t){return function(){return this.matches(t)}}function $b(t){return function(r){return r.matches(t)}}var fR=Array.prototype.find;function dR(t){return function(){return fR.call(this.children,t)}}function hR(){return this.firstElementChild}function mR(t){return this.select(t==null?hR:dR(typeof t=="function"?t:$b(t)))}var pR=Array.prototype.filter;function gR(){return Array.from(this.children)}function yR(t){return function(){return pR.call(this.children,t)}}function xR(t){return this.selectAll(t==null?gR:yR(typeof t=="function"?t:$b(t)))}function vR(t){typeof t!="function"&&(t=Pb(t));for(var r=this._groups,o=r.length,a=new Array(o),s=0;s<o;++s)for(var u=r[s],f=u.length,h=a[s]=[],p,m=0;m<f;++m)(p=u[m])&&t.call(p,p.__data__,m,u)&&h.push(p);return new Jt(a,this._parents)}function Zb(t){return new Array(t.length)}function bR(){return new Jt(this._enter||this._groups.map(Zb),this._parents)}function Du(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}Du.prototype={constructor:Du,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,r){return this._parent.insertBefore(t,r)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function _R(t){return function(){return t}}function ER(t,r,o,a,s,u){for(var f=0,h,p=r.length,m=u.length;f<m;++f)(h=r[f])?(h.__data__=u[f],a[f]=h):o[f]=new Du(t,u[f]);for(;f<p;++f)(h=r[f])&&(s[f]=h)}function SR(t,r,o,a,s,u,f){var h,p,m=new Map,y=r.length,g=u.length,x=new Array(y),_;for(h=0;h<y;++h)(p=r[h])&&(x[h]=_=f.call(p,p.__data__,h,r)+"",m.has(_)?s[h]=p:m.set(_,p));for(h=0;h<g;++h)_=f.call(t,u[h],h,u)+"",(p=m.get(_))?(a[h]=p,p.__data__=u[h],m.delete(_)):o[h]=new Du(t,u[h]);for(h=0;h<y;++h)(p=r[h])&&m.get(x[h])===p&&(s[h]=p)}function wR(t){return t.__data__}function AR(t,r){if(!arguments.length)return Array.from(this,wR);var o=r?SR:ER,a=this._parents,s=this._groups;typeof t!="function"&&(t=_R(t));for(var u=s.length,f=new Array(u),h=new Array(u),p=new Array(u),m=0;m<u;++m){var y=a[m],g=s[m],x=g.length,_=TR(t.call(y,y&&y.__data__,m,a)),b=_.length,E=h[m]=new Array(b),C=f[m]=new Array(b),w=p[m]=new Array(x);o(y,g,E,C,w,_,r);for(var D=0,S=0,N,O;D<b;++D)if(N=E[D]){for(D>=S&&(S=D+1);!(O=C[S])&&++S<b;);N._next=O||null}}return f=new Jt(f,a),f._enter=h,f._exit=p,f}function TR(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function CR(){return new Jt(this._exit||this._groups.map(Zb),this._parents)}function NR(t,r,o){var a=this.enter(),s=this,u=this.exit();return typeof t=="function"?(a=t(a),a&&(a=a.selection())):a=a.append(t+""),r!=null&&(s=r(s),s&&(s=s.selection())),o==null?u.remove():o(u),a&&s?a.merge(s).order():s}function RR(t){for(var r=t.selection?t.selection():t,o=this._groups,a=r._groups,s=o.length,u=a.length,f=Math.min(s,u),h=new Array(s),p=0;p<f;++p)for(var m=o[p],y=a[p],g=m.length,x=h[p]=new Array(g),_,b=0;b<g;++b)(_=m[b]||y[b])&&(x[b]=_);for(;p<s;++p)h[p]=o[p];return new Jt(h,this._parents)}function MR(){for(var t=this._groups,r=-1,o=t.length;++r<o;)for(var a=t[r],s=a.length-1,u=a[s],f;--s>=0;)(f=a[s])&&(u&&f.compareDocumentPosition(u)^4&&u.parentNode.insertBefore(f,u),u=f);return this}function DR(t){t||(t=OR);function r(g,x){return g&&x?t(g.__data__,x.__data__):!g-!x}for(var o=this._groups,a=o.length,s=new Array(a),u=0;u<a;++u){for(var f=o[u],h=f.length,p=s[u]=new Array(h),m,y=0;y<h;++y)(m=f[y])&&(p[y]=m);p.sort(r)}return new Jt(s,this._parents).order()}function OR(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function zR(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function BR(){return Array.from(this)}function UR(){for(var t=this._groups,r=0,o=t.length;r<o;++r)for(var a=t[r],s=0,u=a.length;s<u;++s){var f=a[s];if(f)return f}return null}function HR(){let t=0;for(const r of this)++t;return t}function LR(){return!this.node()}function jR(t){for(var r=this._groups,o=0,a=r.length;o<a;++o)for(var s=r[o],u=0,f=s.length,h;u<f;++u)(h=s[u])&&t.call(h,h.__data__,u,s);return this}function FR(t){return function(){this.removeAttribute(t)}}function kR(t){return function(){this.removeAttributeNS(t.space,t.local)}}function VR(t,r){return function(){this.setAttribute(t,r)}}function GR(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function qR(t,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttribute(t):this.setAttribute(t,o)}}function XR(t,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,o)}}function YR(t,r){var o=oc(t);if(arguments.length<2){var a=this.node();return o.local?a.getAttributeNS(o.space,o.local):a.getAttribute(o)}return this.each((r==null?o.local?kR:FR:typeof r=="function"?o.local?XR:qR:o.local?GR:VR)(o,r))}function Qb(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function IR(t){return function(){this.style.removeProperty(t)}}function PR(t,r,o){return function(){this.style.setProperty(t,r,o)}}function $R(t,r,o){return function(){var a=r.apply(this,arguments);a==null?this.style.removeProperty(t):this.style.setProperty(t,a,o)}}function ZR(t,r,o){return arguments.length>1?this.each((r==null?IR:typeof r=="function"?$R:PR)(t,r,o??"")):Hi(this.node(),t)}function Hi(t,r){return t.style.getPropertyValue(r)||Qb(t).getComputedStyle(t,null).getPropertyValue(r)}function QR(t){return function(){delete this[t]}}function KR(t,r){return function(){this[t]=r}}function JR(t,r){return function(){var o=r.apply(this,arguments);o==null?delete this[t]:this[t]=o}}function WR(t,r){return arguments.length>1?this.each((r==null?QR:typeof r=="function"?JR:KR)(t,r)):this.node()[t]}function Kb(t){return t.trim().split(/^|\s+/)}function w0(t){return t.classList||new Jb(t)}function Jb(t){this._node=t,this._names=Kb(t.getAttribute("class")||"")}Jb.prototype={add:function(t){var r=this._names.indexOf(t);r<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var r=this._names.indexOf(t);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Wb(t,r){for(var o=w0(t),a=-1,s=r.length;++a<s;)o.add(r[a])}function e_(t,r){for(var o=w0(t),a=-1,s=r.length;++a<s;)o.remove(r[a])}function e4(t){return function(){Wb(this,t)}}function t4(t){return function(){e_(this,t)}}function n4(t,r){return function(){(r.apply(this,arguments)?Wb:e_)(this,t)}}function r4(t,r){var o=Kb(t+"");if(arguments.length<2){for(var a=w0(this.node()),s=-1,u=o.length;++s<u;)if(!a.contains(o[s]))return!1;return!0}return this.each((typeof r=="function"?n4:r?e4:t4)(o,r))}function o4(){this.textContent=""}function i4(t){return function(){this.textContent=t}}function a4(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function l4(t){return arguments.length?this.each(t==null?o4:(typeof t=="function"?a4:i4)(t)):this.node().textContent}function s4(){this.innerHTML=""}function u4(t){return function(){this.innerHTML=t}}function c4(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function f4(t){return arguments.length?this.each(t==null?s4:(typeof t=="function"?c4:u4)(t)):this.node().innerHTML}function d4(){this.nextSibling&&this.parentNode.appendChild(this)}function h4(){return this.each(d4)}function m4(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function p4(){return this.each(m4)}function g4(t){var r=typeof t=="function"?t:Yb(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function y4(){return null}function x4(t,r){var o=typeof t=="function"?t:Yb(t),a=r==null?y4:typeof r=="function"?r:S0(r);return this.select(function(){return this.insertBefore(o.apply(this,arguments),a.apply(this,arguments)||null)})}function v4(){var t=this.parentNode;t&&t.removeChild(this)}function b4(){return this.each(v4)}function _4(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function E4(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function S4(t){return this.select(t?E4:_4)}function w4(t){return arguments.length?this.property("__data__",t):this.node().__data__}function A4(t){return function(r){t.call(this,r,this.__data__)}}function T4(t){return t.trim().split(/^|\s+/).map(function(r){var o="",a=r.indexOf(".");return a>=0&&(o=r.slice(a+1),r=r.slice(0,a)),{type:r,name:o}})}function C4(t){return function(){var r=this.__on;if(r){for(var o=0,a=-1,s=r.length,u;o<s;++o)u=r[o],(!t.type||u.type===t.type)&&u.name===t.name?this.removeEventListener(u.type,u.listener,u.options):r[++a]=u;++a?r.length=a:delete this.__on}}}function N4(t,r,o){return function(){var a=this.__on,s,u=A4(r);if(a){for(var f=0,h=a.length;f<h;++f)if((s=a[f]).type===t.type&&s.name===t.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=u,s.options=o),s.value=r;return}}this.addEventListener(t.type,u,o),s={type:t.type,name:t.name,value:r,listener:u,options:o},a?a.push(s):this.__on=[s]}}function R4(t,r,o){var a=T4(t+""),s,u=a.length,f;if(arguments.length<2){var h=this.node().__on;if(h){for(var p=0,m=h.length,y;p<m;++p)for(s=0,y=h[p];s<u;++s)if((f=a[s]).type===y.type&&f.name===y.name)return y.value}return}for(h=r?N4:C4,s=0;s<u;++s)this.each(h(a[s],r,o));return this}function t_(t,r,o){var a=Qb(t),s=a.CustomEvent;typeof s=="function"?s=new s(r,o):(s=a.document.createEvent("Event"),o?(s.initEvent(r,o.bubbles,o.cancelable),s.detail=o.detail):s.initEvent(r,!1,!1)),t.dispatchEvent(s)}function M4(t,r){return function(){return t_(this,t,r)}}function D4(t,r){return function(){return t_(this,t,r.apply(this,arguments))}}function O4(t,r){return this.each((typeof r=="function"?D4:M4)(t,r))}function*z4(){for(var t=this._groups,r=0,o=t.length;r<o;++r)for(var a=t[r],s=0,u=a.length,f;s<u;++s)(f=a[s])&&(yield f)}var n_=[null];function Jt(t,r){this._groups=t,this._parents=r}function yl(){return new Jt([[document.documentElement]],n_)}function B4(){return this}Jt.prototype=yl.prototype={constructor:Jt,select:aR,selectAll:cR,selectChild:mR,selectChildren:xR,filter:vR,data:AR,enter:bR,exit:CR,join:NR,merge:RR,selection:B4,order:MR,sort:DR,call:zR,nodes:BR,node:UR,size:HR,empty:LR,each:jR,attr:YR,style:ZR,property:WR,classed:r4,text:l4,html:f4,raise:h4,lower:p4,append:g4,insert:x4,remove:b4,clone:S4,datum:w4,on:R4,dispatch:O4,[Symbol.iterator]:z4};function Kt(t){return typeof t=="string"?new Jt([[document.querySelector(t)]],[document.documentElement]):new Jt([[t]],n_)}function U4(t){let r;for(;r=t.sourceEvent;)t=r;return t}function yn(t,r){if(t=U4(t),r===void 0&&(r=t.currentTarget),r){var o=r.ownerSVGElement||r;if(o.createSVGPoint){var a=o.createSVGPoint();return a.x=t.clientX,a.y=t.clientY,a=a.matrixTransform(r.getScreenCTM().inverse()),[a.x,a.y]}if(r.getBoundingClientRect){var s=r.getBoundingClientRect();return[t.clientX-s.left-r.clientLeft,t.clientY-s.top-r.clientTop]}}return[t.pageX,t.pageY]}const H4={passive:!1},rl={capture:!0,passive:!1};function Id(t){t.stopImmediatePropagation()}function zi(t){t.preventDefault(),t.stopImmediatePropagation()}function r_(t){var r=t.document.documentElement,o=Kt(t).on("dragstart.drag",zi,rl);"onselectstart"in r?o.on("selectstart.drag",zi,rl):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function o_(t,r){var o=t.document.documentElement,a=Kt(t).on("dragstart.drag",null);r&&(a.on("click.drag",zi,rl),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in o?a.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const nu=t=>()=>t;function Sh(t,{sourceEvent:r,subject:o,target:a,identifier:s,active:u,x:f,y:h,dx:p,dy:m,dispatch:y}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:o,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:u,enumerable:!0,configurable:!0},x:{value:f,enumerable:!0,configurable:!0},y:{value:h,enumerable:!0,configurable:!0},dx:{value:p,enumerable:!0,configurable:!0},dy:{value:m,enumerable:!0,configurable:!0},_:{value:y}})}Sh.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function L4(t){return!t.ctrlKey&&!t.button}function j4(){return this.parentNode}function F4(t,r){return r??{x:t.x,y:t.y}}function k4(){return navigator.maxTouchPoints||"ontouchstart"in this}function i_(){var t=L4,r=j4,o=F4,a=k4,s={},u=rc("start","drag","end"),f=0,h,p,m,y,g=0;function x(N){N.on("mousedown.drag",_).filter(a).on("touchstart.drag",C).on("touchmove.drag",w,H4).on("touchend.drag touchcancel.drag",D).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(N,O){if(!(y||!t.call(this,N,O))){var z=S(this,r.call(this,N,O),N,O,"mouse");z&&(Kt(N.view).on("mousemove.drag",b,rl).on("mouseup.drag",E,rl),r_(N.view),Id(N),m=!1,h=N.clientX,p=N.clientY,z("start",N))}}function b(N){if(zi(N),!m){var O=N.clientX-h,z=N.clientY-p;m=O*O+z*z>g}s.mouse("drag",N)}function E(N){Kt(N.view).on("mousemove.drag mouseup.drag",null),o_(N.view,m),zi(N),s.mouse("end",N)}function C(N,O){if(t.call(this,N,O)){var z=N.changedTouches,B=r.call(this,N,O),q=z.length,I,ae;for(I=0;I<q;++I)(ae=S(this,B,N,O,z[I].identifier,z[I]))&&(Id(N),ae("start",N,z[I]))}}function w(N){var O=N.changedTouches,z=O.length,B,q;for(B=0;B<z;++B)(q=s[O[B].identifier])&&(zi(N),q("drag",N,O[B]))}function D(N){var O=N.changedTouches,z=O.length,B,q;for(y&&clearTimeout(y),y=setTimeout(function(){y=null},500),B=0;B<z;++B)(q=s[O[B].identifier])&&(Id(N),q("end",N,O[B]))}function S(N,O,z,B,q,I){var ae=u.copy(),V=yn(I||z,O),$,ee,U;if((U=o.call(N,new Sh("beforestart",{sourceEvent:z,target:x,identifier:q,active:f,x:V[0],y:V[1],dx:0,dy:0,dispatch:ae}),B))!=null)return $=U.x-V[0]||0,ee=U.y-V[1]||0,function X(R,H,F){var P=V,te;switch(R){case"start":s[q]=X,te=f++;break;case"end":delete s[q],--f;case"drag":V=yn(F||H,O),te=f;break}ae.call(R,N,new Sh(R,{sourceEvent:H,subject:U,target:x,identifier:q,active:te,x:V[0]+$,y:V[1]+ee,dx:V[0]-P[0],dy:V[1]-P[1],dispatch:ae}),B)}}return x.filter=function(N){return arguments.length?(t=typeof N=="function"?N:nu(!!N),x):t},x.container=function(N){return arguments.length?(r=typeof N=="function"?N:nu(N),x):r},x.subject=function(N){return arguments.length?(o=typeof N=="function"?N:nu(N),x):o},x.touchable=function(N){return arguments.length?(a=typeof N=="function"?N:nu(!!N),x):a},x.on=function(){var N=u.on.apply(u,arguments);return N===u?x:N},x.clickDistance=function(N){return arguments.length?(g=(N=+N)*N,x):Math.sqrt(g)},x}function A0(t,r,o){t.prototype=r.prototype=o,o.constructor=t}function a_(t,r){var o=Object.create(t.prototype);for(var a in r)o[a]=r[a];return o}function xl(){}var ol=.7,Ou=1/ol,Bi="\\s*([+-]?\\d+)\\s*",il="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",V4=/^#([0-9a-f]{3,8})$/,G4=new RegExp(`^rgb\\(${Bi},${Bi},${Bi}\\)$`),q4=new RegExp(`^rgb\\(${zn},${zn},${zn}\\)$`),X4=new RegExp(`^rgba\\(${Bi},${Bi},${Bi},${il}\\)$`),Y4=new RegExp(`^rgba\\(${zn},${zn},${zn},${il}\\)$`),I4=new RegExp(`^hsl\\(${il},${zn},${zn}\\)$`),P4=new RegExp(`^hsla\\(${il},${zn},${zn},${il}\\)$`),u1={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};A0(xl,zo,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:c1,formatHex:c1,formatHex8:$4,formatHsl:Z4,formatRgb:f1,toString:f1});function c1(){return this.rgb().formatHex()}function $4(){return this.rgb().formatHex8()}function Z4(){return l_(this).formatHsl()}function f1(){return this.rgb().formatRgb()}function zo(t){var r,o;return t=(t+"").trim().toLowerCase(),(r=V4.exec(t))?(o=r[1].length,r=parseInt(r[1],16),o===6?d1(r):o===3?new Gt(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):o===8?ru(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):o===4?ru(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=G4.exec(t))?new Gt(r[1],r[2],r[3],1):(r=q4.exec(t))?new Gt(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=X4.exec(t))?ru(r[1],r[2],r[3],r[4]):(r=Y4.exec(t))?ru(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=I4.exec(t))?p1(r[1],r[2]/100,r[3]/100,1):(r=P4.exec(t))?p1(r[1],r[2]/100,r[3]/100,r[4]):u1.hasOwnProperty(t)?d1(u1[t]):t==="transparent"?new Gt(NaN,NaN,NaN,0):null}function d1(t){return new Gt(t>>16&255,t>>8&255,t&255,1)}function ru(t,r,o,a){return a<=0&&(t=r=o=NaN),new Gt(t,r,o,a)}function Q4(t){return t instanceof xl||(t=zo(t)),t?(t=t.rgb(),new Gt(t.r,t.g,t.b,t.opacity)):new Gt}function wh(t,r,o,a){return arguments.length===1?Q4(t):new Gt(t,r,o,a??1)}function Gt(t,r,o,a){this.r=+t,this.g=+r,this.b=+o,this.opacity=+a}A0(Gt,wh,a_(xl,{brighter(t){return t=t==null?Ou:Math.pow(Ou,t),new Gt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ol:Math.pow(ol,t),new Gt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Gt(Ro(this.r),Ro(this.g),Ro(this.b),zu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:h1,formatHex:h1,formatHex8:K4,formatRgb:m1,toString:m1}));function h1(){return`#${No(this.r)}${No(this.g)}${No(this.b)}`}function K4(){return`#${No(this.r)}${No(this.g)}${No(this.b)}${No((isNaN(this.opacity)?1:this.opacity)*255)}`}function m1(){const t=zu(this.opacity);return`${t===1?"rgb(":"rgba("}${Ro(this.r)}, ${Ro(this.g)}, ${Ro(this.b)}${t===1?")":`, ${t})`}`}function zu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ro(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function No(t){return t=Ro(t),(t<16?"0":"")+t.toString(16)}function p1(t,r,o,a){return a<=0?t=r=o=NaN:o<=0||o>=1?t=r=NaN:r<=0&&(t=NaN),new xn(t,r,o,a)}function l_(t){if(t instanceof xn)return new xn(t.h,t.s,t.l,t.opacity);if(t instanceof xl||(t=zo(t)),!t)return new xn;if(t instanceof xn)return t;t=t.rgb();var r=t.r/255,o=t.g/255,a=t.b/255,s=Math.min(r,o,a),u=Math.max(r,o,a),f=NaN,h=u-s,p=(u+s)/2;return h?(r===u?f=(o-a)/h+(o<a)*6:o===u?f=(a-r)/h+2:f=(r-o)/h+4,h/=p<.5?u+s:2-u-s,f*=60):h=p>0&&p<1?0:f,new xn(f,h,p,t.opacity)}function J4(t,r,o,a){return arguments.length===1?l_(t):new xn(t,r,o,a??1)}function xn(t,r,o,a){this.h=+t,this.s=+r,this.l=+o,this.opacity=+a}A0(xn,J4,a_(xl,{brighter(t){return t=t==null?Ou:Math.pow(Ou,t),new xn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ol:Math.pow(ol,t),new xn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,r=isNaN(t)||isNaN(this.s)?0:this.s,o=this.l,a=o+(o<.5?o:1-o)*r,s=2*o-a;return new Gt(Pd(t>=240?t-240:t+120,s,a),Pd(t,s,a),Pd(t<120?t+240:t-120,s,a),this.opacity)},clamp(){return new xn(g1(this.h),ou(this.s),ou(this.l),zu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=zu(this.opacity);return`${t===1?"hsl(":"hsla("}${g1(this.h)}, ${ou(this.s)*100}%, ${ou(this.l)*100}%${t===1?")":`, ${t})`}`}}));function g1(t){return t=(t||0)%360,t<0?t+360:t}function ou(t){return Math.max(0,Math.min(1,t||0))}function Pd(t,r,o){return(t<60?r+(o-r)*t/60:t<180?o:t<240?r+(o-r)*(240-t)/60:r)*255}const T0=t=>()=>t;function W4(t,r){return function(o){return t+o*r}}function eM(t,r,o){return t=Math.pow(t,o),r=Math.pow(r,o)-t,o=1/o,function(a){return Math.pow(t+a*r,o)}}function tM(t){return(t=+t)==1?s_:function(r,o){return o-r?eM(r,o,t):T0(isNaN(r)?o:r)}}function s_(t,r){var o=r-t;return o?W4(t,o):T0(isNaN(t)?r:t)}const Bu=(function t(r){var o=tM(r);function a(s,u){var f=o((s=wh(s)).r,(u=wh(u)).r),h=o(s.g,u.g),p=o(s.b,u.b),m=s_(s.opacity,u.opacity);return function(y){return s.r=f(y),s.g=h(y),s.b=p(y),s.opacity=m(y),s+""}}return a.gamma=t,a})(1);function nM(t,r){r||(r=[]);var o=t?Math.min(r.length,t.length):0,a=r.slice(),s;return function(u){for(s=0;s<o;++s)a[s]=t[s]*(1-u)+r[s]*u;return a}}function rM(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function oM(t,r){var o=r?r.length:0,a=t?Math.min(o,t.length):0,s=new Array(a),u=new Array(o),f;for(f=0;f<a;++f)s[f]=Ka(t[f],r[f]);for(;f<o;++f)u[f]=r[f];return function(h){for(f=0;f<a;++f)u[f]=s[f](h);return u}}function iM(t,r){var o=new Date;return t=+t,r=+r,function(a){return o.setTime(t*(1-a)+r*a),o}}function Dn(t,r){return t=+t,r=+r,function(o){return t*(1-o)+r*o}}function aM(t,r){var o={},a={},s;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(s in r)s in t?o[s]=Ka(t[s],r[s]):a[s]=r[s];return function(u){for(s in o)a[s]=o[s](u);return a}}var Ah=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$d=new RegExp(Ah.source,"g");function lM(t){return function(){return t}}function sM(t){return function(r){return t(r)+""}}function u_(t,r){var o=Ah.lastIndex=$d.lastIndex=0,a,s,u,f=-1,h=[],p=[];for(t=t+"",r=r+"";(a=Ah.exec(t))&&(s=$d.exec(r));)(u=s.index)>o&&(u=r.slice(o,u),h[f]?h[f]+=u:h[++f]=u),(a=a[0])===(s=s[0])?h[f]?h[f]+=s:h[++f]=s:(h[++f]=null,p.push({i:f,x:Dn(a,s)})),o=$d.lastIndex;return o<r.length&&(u=r.slice(o),h[f]?h[f]+=u:h[++f]=u),h.length<2?p[0]?sM(p[0].x):lM(r):(r=p.length,function(m){for(var y=0,g;y<r;++y)h[(g=p[y]).i]=g.x(m);return h.join("")})}function Ka(t,r){var o=typeof r,a;return r==null||o==="boolean"?T0(r):(o==="number"?Dn:o==="string"?(a=zo(r))?(r=a,Bu):u_:r instanceof zo?Bu:r instanceof Date?iM:rM(r)?nM:Array.isArray(r)?oM:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?aM:Dn)(t,r)}var y1=180/Math.PI,Th={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function c_(t,r,o,a,s,u){var f,h,p;return(f=Math.sqrt(t*t+r*r))&&(t/=f,r/=f),(p=t*o+r*a)&&(o-=t*p,a-=r*p),(h=Math.sqrt(o*o+a*a))&&(o/=h,a/=h,p/=h),t*a<r*o&&(t=-t,r=-r,p=-p,f=-f),{translateX:s,translateY:u,rotate:Math.atan2(r,t)*y1,skewX:Math.atan(p)*y1,scaleX:f,scaleY:h}}var iu;function uM(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?Th:c_(r.a,r.b,r.c,r.d,r.e,r.f)}function cM(t){return t==null||(iu||(iu=document.createElementNS("http://www.w3.org/2000/svg","g")),iu.setAttribute("transform",t),!(t=iu.transform.baseVal.consolidate()))?Th:(t=t.matrix,c_(t.a,t.b,t.c,t.d,t.e,t.f))}function f_(t,r,o,a){function s(m){return m.length?m.pop()+" ":""}function u(m,y,g,x,_,b){if(m!==g||y!==x){var E=_.push("translate(",null,r,null,o);b.push({i:E-4,x:Dn(m,g)},{i:E-2,x:Dn(y,x)})}else(g||x)&&_.push("translate("+g+r+x+o)}function f(m,y,g,x){m!==y?(m-y>180?y+=360:y-m>180&&(m+=360),x.push({i:g.push(s(g)+"rotate(",null,a)-2,x:Dn(m,y)})):y&&g.push(s(g)+"rotate("+y+a)}function h(m,y,g,x){m!==y?x.push({i:g.push(s(g)+"skewX(",null,a)-2,x:Dn(m,y)}):y&&g.push(s(g)+"skewX("+y+a)}function p(m,y,g,x,_,b){if(m!==g||y!==x){var E=_.push(s(_)+"scale(",null,",",null,")");b.push({i:E-4,x:Dn(m,g)},{i:E-2,x:Dn(y,x)})}else(g!==1||x!==1)&&_.push(s(_)+"scale("+g+","+x+")")}return function(m,y){var g=[],x=[];return m=t(m),y=t(y),u(m.translateX,m.translateY,y.translateX,y.translateY,g,x),f(m.rotate,y.rotate,g,x),h(m.skewX,y.skewX,g,x),p(m.scaleX,m.scaleY,y.scaleX,y.scaleY,g,x),m=y=null,function(_){for(var b=-1,E=x.length,C;++b<E;)g[(C=x[b]).i]=C.x(_);return g.join("")}}}var fM=f_(uM,"px, ","px)","deg)"),dM=f_(cM,", ",")",")"),hM=1e-12;function x1(t){return((t=Math.exp(t))+1/t)/2}function mM(t){return((t=Math.exp(t))-1/t)/2}function pM(t){return((t=Math.exp(2*t))-1)/(t+1)}const bu=(function t(r,o,a){function s(u,f){var h=u[0],p=u[1],m=u[2],y=f[0],g=f[1],x=f[2],_=y-h,b=g-p,E=_*_+b*b,C,w;if(E<hM)w=Math.log(x/m)/r,C=function(B){return[h+B*_,p+B*b,m*Math.exp(r*B*w)]};else{var D=Math.sqrt(E),S=(x*x-m*m+a*E)/(2*m*o*D),N=(x*x-m*m-a*E)/(2*x*o*D),O=Math.log(Math.sqrt(S*S+1)-S),z=Math.log(Math.sqrt(N*N+1)-N);w=(z-O)/r,C=function(B){var q=B*w,I=x1(O),ae=m/(o*D)*(I*pM(r*q+O)-mM(O));return[h+ae*_,p+ae*b,m*I/x1(r*q+O)]}}return C.duration=w*1e3*r/Math.SQRT2,C}return s.rho=function(u){var f=Math.max(.001,+u),h=f*f,p=h*h;return t(f,h,p)},s})(Math.SQRT2,2,4);var Li=0,Za=0,Ia=0,d_=1e3,Uu,Qa,Hu=0,Bo=0,ic=0,al=typeof performance=="object"&&performance.now?performance:Date,h_=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function C0(){return Bo||(h_(gM),Bo=al.now()+ic)}function gM(){Bo=0}function Lu(){this._call=this._time=this._next=null}Lu.prototype=m_.prototype={constructor:Lu,restart:function(t,r,o){if(typeof t!="function")throw new TypeError("callback is not a function");o=(o==null?C0():+o)+(r==null?0:+r),!this._next&&Qa!==this&&(Qa?Qa._next=this:Uu=this,Qa=this),this._call=t,this._time=o,Ch()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ch())}};function m_(t,r,o){var a=new Lu;return a.restart(t,r,o),a}function yM(){C0(),++Li;for(var t=Uu,r;t;)(r=Bo-t._time)>=0&&t._call.call(void 0,r),t=t._next;--Li}function v1(){Bo=(Hu=al.now())+ic,Li=Za=0;try{yM()}finally{Li=0,vM(),Bo=0}}function xM(){var t=al.now(),r=t-Hu;r>d_&&(ic-=r,Hu=t)}function vM(){for(var t,r=Uu,o,a=1/0;r;)r._call?(a>r._time&&(a=r._time),t=r,r=r._next):(o=r._next,r._next=null,r=t?t._next=o:Uu=o);Qa=t,Ch(a)}function Ch(t){if(!Li){Za&&(Za=clearTimeout(Za));var r=t-Bo;r>24?(t<1/0&&(Za=setTimeout(v1,t-al.now()-ic)),Ia&&(Ia=clearInterval(Ia))):(Ia||(Hu=al.now(),Ia=setInterval(xM,d_)),Li=1,h_(v1))}}function b1(t,r,o){var a=new Lu;return r=r==null?0:+r,a.restart(s=>{a.stop(),t(s+r)},r,o),a}var bM=rc("start","end","cancel","interrupt"),_M=[],p_=0,_1=1,Nh=2,_u=3,E1=4,Rh=5,Eu=6;function ac(t,r,o,a,s,u){var f=t.__transition;if(!f)t.__transition={};else if(o in f)return;EM(t,o,{name:r,index:a,group:s,on:bM,tween:_M,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:p_})}function N0(t,r){var o=En(t,r);if(o.state>p_)throw new Error("too late; already scheduled");return o}function Fn(t,r){var o=En(t,r);if(o.state>_u)throw new Error("too late; already running");return o}function En(t,r){var o=t.__transition;if(!o||!(o=o[r]))throw new Error("transition not found");return o}function EM(t,r,o){var a=t.__transition,s;a[r]=o,o.timer=m_(u,0,o.time);function u(m){o.state=_1,o.timer.restart(f,o.delay,o.time),o.delay<=m&&f(m-o.delay)}function f(m){var y,g,x,_;if(o.state!==_1)return p();for(y in a)if(_=a[y],_.name===o.name){if(_.state===_u)return b1(f);_.state===E1?(_.state=Eu,_.timer.stop(),_.on.call("interrupt",t,t.__data__,_.index,_.group),delete a[y]):+y<r&&(_.state=Eu,_.timer.stop(),_.on.call("cancel",t,t.__data__,_.index,_.group),delete a[y])}if(b1(function(){o.state===_u&&(o.state=E1,o.timer.restart(h,o.delay,o.time),h(m))}),o.state=Nh,o.on.call("start",t,t.__data__,o.index,o.group),o.state===Nh){for(o.state=_u,s=new Array(x=o.tween.length),y=0,g=-1;y<x;++y)(_=o.tween[y].value.call(t,t.__data__,o.index,o.group))&&(s[++g]=_);s.length=g+1}}function h(m){for(var y=m<o.duration?o.ease.call(null,m/o.duration):(o.timer.restart(p),o.state=Rh,1),g=-1,x=s.length;++g<x;)s[g].call(t,y);o.state===Rh&&(o.on.call("end",t,t.__data__,o.index,o.group),p())}function p(){o.state=Eu,o.timer.stop(),delete a[r];for(var m in a)return;delete t.__transition}}function Su(t,r){var o=t.__transition,a,s,u=!0,f;if(o){r=r==null?null:r+"";for(f in o){if((a=o[f]).name!==r){u=!1;continue}s=a.state>Nh&&a.state<Rh,a.state=Eu,a.timer.stop(),a.on.call(s?"interrupt":"cancel",t,t.__data__,a.index,a.group),delete o[f]}u&&delete t.__transition}}function SM(t){return this.each(function(){Su(this,t)})}function wM(t,r){var o,a;return function(){var s=Fn(this,t),u=s.tween;if(u!==o){a=o=u;for(var f=0,h=a.length;f<h;++f)if(a[f].name===r){a=a.slice(),a.splice(f,1);break}}s.tween=a}}function AM(t,r,o){var a,s;if(typeof o!="function")throw new Error;return function(){var u=Fn(this,t),f=u.tween;if(f!==a){s=(a=f).slice();for(var h={name:r,value:o},p=0,m=s.length;p<m;++p)if(s[p].name===r){s[p]=h;break}p===m&&s.push(h)}u.tween=s}}function TM(t,r){var o=this._id;if(t+="",arguments.length<2){for(var a=En(this.node(),o).tween,s=0,u=a.length,f;s<u;++s)if((f=a[s]).name===t)return f.value;return null}return this.each((r==null?wM:AM)(o,t,r))}function R0(t,r,o){var a=t._id;return t.each(function(){var s=Fn(this,a);(s.value||(s.value={}))[r]=o.apply(this,arguments)}),function(s){return En(s,a).value[r]}}function g_(t,r){var o;return(typeof r=="number"?Dn:r instanceof zo?Bu:(o=zo(r))?(r=o,Bu):u_)(t,r)}function CM(t){return function(){this.removeAttribute(t)}}function NM(t){return function(){this.removeAttributeNS(t.space,t.local)}}function RM(t,r,o){var a,s=o+"",u;return function(){var f=this.getAttribute(t);return f===s?null:f===a?u:u=r(a=f,o)}}function MM(t,r,o){var a,s=o+"",u;return function(){var f=this.getAttributeNS(t.space,t.local);return f===s?null:f===a?u:u=r(a=f,o)}}function DM(t,r,o){var a,s,u;return function(){var f,h=o(this),p;return h==null?void this.removeAttribute(t):(f=this.getAttribute(t),p=h+"",f===p?null:f===a&&p===s?u:(s=p,u=r(a=f,h)))}}function OM(t,r,o){var a,s,u;return function(){var f,h=o(this),p;return h==null?void this.removeAttributeNS(t.space,t.local):(f=this.getAttributeNS(t.space,t.local),p=h+"",f===p?null:f===a&&p===s?u:(s=p,u=r(a=f,h)))}}function zM(t,r){var o=oc(t),a=o==="transform"?dM:g_;return this.attrTween(t,typeof r=="function"?(o.local?OM:DM)(o,a,R0(this,"attr."+t,r)):r==null?(o.local?NM:CM)(o):(o.local?MM:RM)(o,a,r))}function BM(t,r){return function(o){this.setAttribute(t,r.call(this,o))}}function UM(t,r){return function(o){this.setAttributeNS(t.space,t.local,r.call(this,o))}}function HM(t,r){var o,a;function s(){var u=r.apply(this,arguments);return u!==a&&(o=(a=u)&&UM(t,u)),o}return s._value=r,s}function LM(t,r){var o,a;function s(){var u=r.apply(this,arguments);return u!==a&&(o=(a=u)&&BM(t,u)),o}return s._value=r,s}function jM(t,r){var o="attr."+t;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(r==null)return this.tween(o,null);if(typeof r!="function")throw new Error;var a=oc(t);return this.tween(o,(a.local?HM:LM)(a,r))}function FM(t,r){return function(){N0(this,t).delay=+r.apply(this,arguments)}}function kM(t,r){return r=+r,function(){N0(this,t).delay=r}}function VM(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?FM:kM)(r,t)):En(this.node(),r).delay}function GM(t,r){return function(){Fn(this,t).duration=+r.apply(this,arguments)}}function qM(t,r){return r=+r,function(){Fn(this,t).duration=r}}function XM(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?GM:qM)(r,t)):En(this.node(),r).duration}function YM(t,r){if(typeof r!="function")throw new Error;return function(){Fn(this,t).ease=r}}function IM(t){var r=this._id;return arguments.length?this.each(YM(r,t)):En(this.node(),r).ease}function PM(t,r){return function(){var o=r.apply(this,arguments);if(typeof o!="function")throw new Error;Fn(this,t).ease=o}}function $M(t){if(typeof t!="function")throw new Error;return this.each(PM(this._id,t))}function ZM(t){typeof t!="function"&&(t=Pb(t));for(var r=this._groups,o=r.length,a=new Array(o),s=0;s<o;++s)for(var u=r[s],f=u.length,h=a[s]=[],p,m=0;m<f;++m)(p=u[m])&&t.call(p,p.__data__,m,u)&&h.push(p);return new fr(a,this._parents,this._name,this._id)}function QM(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,o=t._groups,a=r.length,s=o.length,u=Math.min(a,s),f=new Array(a),h=0;h<u;++h)for(var p=r[h],m=o[h],y=p.length,g=f[h]=new Array(y),x,_=0;_<y;++_)(x=p[_]||m[_])&&(g[_]=x);for(;h<a;++h)f[h]=r[h];return new fr(f,this._parents,this._name,this._id)}function KM(t){return(t+"").trim().split(/^|\s+/).every(function(r){var o=r.indexOf(".");return o>=0&&(r=r.slice(0,o)),!r||r==="start"})}function JM(t,r,o){var a,s,u=KM(r)?N0:Fn;return function(){var f=u(this,t),h=f.on;h!==a&&(s=(a=h).copy()).on(r,o),f.on=s}}function WM(t,r){var o=this._id;return arguments.length<2?En(this.node(),o).on.on(t):this.each(JM(o,t,r))}function e8(t){return function(){var r=this.parentNode;for(var o in this.__transition)if(+o!==t)return;r&&r.removeChild(this)}}function t8(){return this.on("end.remove",e8(this._id))}function n8(t){var r=this._name,o=this._id;typeof t!="function"&&(t=S0(t));for(var a=this._groups,s=a.length,u=new Array(s),f=0;f<s;++f)for(var h=a[f],p=h.length,m=u[f]=new Array(p),y,g,x=0;x<p;++x)(y=h[x])&&(g=t.call(y,y.__data__,x,h))&&("__data__"in y&&(g.__data__=y.__data__),m[x]=g,ac(m[x],r,o,x,m,En(y,o)));return new fr(u,this._parents,r,o)}function r8(t){var r=this._name,o=this._id;typeof t!="function"&&(t=Ib(t));for(var a=this._groups,s=a.length,u=[],f=[],h=0;h<s;++h)for(var p=a[h],m=p.length,y,g=0;g<m;++g)if(y=p[g]){for(var x=t.call(y,y.__data__,g,p),_,b=En(y,o),E=0,C=x.length;E<C;++E)(_=x[E])&&ac(_,r,o,E,x,b);u.push(x),f.push(y)}return new fr(u,f,r,o)}var o8=yl.prototype.constructor;function i8(){return new o8(this._groups,this._parents)}function a8(t,r){var o,a,s;return function(){var u=Hi(this,t),f=(this.style.removeProperty(t),Hi(this,t));return u===f?null:u===o&&f===a?s:s=r(o=u,a=f)}}function y_(t){return function(){this.style.removeProperty(t)}}function l8(t,r,o){var a,s=o+"",u;return function(){var f=Hi(this,t);return f===s?null:f===a?u:u=r(a=f,o)}}function s8(t,r,o){var a,s,u;return function(){var f=Hi(this,t),h=o(this),p=h+"";return h==null&&(p=h=(this.style.removeProperty(t),Hi(this,t))),f===p?null:f===a&&p===s?u:(s=p,u=r(a=f,h))}}function u8(t,r){var o,a,s,u="style."+r,f="end."+u,h;return function(){var p=Fn(this,t),m=p.on,y=p.value[u]==null?h||(h=y_(r)):void 0;(m!==o||s!==y)&&(a=(o=m).copy()).on(f,s=y),p.on=a}}function c8(t,r,o){var a=(t+="")=="transform"?fM:g_;return r==null?this.styleTween(t,a8(t,a)).on("end.style."+t,y_(t)):typeof r=="function"?this.styleTween(t,s8(t,a,R0(this,"style."+t,r))).each(u8(this._id,t)):this.styleTween(t,l8(t,a,r),o).on("end.style."+t,null)}function f8(t,r,o){return function(a){this.style.setProperty(t,r.call(this,a),o)}}function d8(t,r,o){var a,s;function u(){var f=r.apply(this,arguments);return f!==s&&(a=(s=f)&&f8(t,f,o)),a}return u._value=r,u}function h8(t,r,o){var a="style."+(t+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(r==null)return this.tween(a,null);if(typeof r!="function")throw new Error;return this.tween(a,d8(t,r,o??""))}function m8(t){return function(){this.textContent=t}}function p8(t){return function(){var r=t(this);this.textContent=r??""}}function g8(t){return this.tween("text",typeof t=="function"?p8(R0(this,"text",t)):m8(t==null?"":t+""))}function y8(t){return function(r){this.textContent=t.call(this,r)}}function x8(t){var r,o;function a(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&y8(s)),r}return a._value=t,a}function v8(t){var r="text";if(arguments.length<1)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,x8(t))}function b8(){for(var t=this._name,r=this._id,o=x_(),a=this._groups,s=a.length,u=0;u<s;++u)for(var f=a[u],h=f.length,p,m=0;m<h;++m)if(p=f[m]){var y=En(p,r);ac(p,t,o,m,f,{time:y.time+y.delay+y.duration,delay:0,duration:y.duration,ease:y.ease})}return new fr(a,this._parents,t,o)}function _8(){var t,r,o=this,a=o._id,s=o.size();return new Promise(function(u,f){var h={value:f},p={value:function(){--s===0&&u()}};o.each(function(){var m=Fn(this,a),y=m.on;y!==t&&(r=(t=y).copy(),r._.cancel.push(h),r._.interrupt.push(h),r._.end.push(p)),m.on=r}),s===0&&u()})}var E8=0;function fr(t,r,o,a){this._groups=t,this._parents=r,this._name=o,this._id=a}function x_(){return++E8}var lr=yl.prototype;fr.prototype={constructor:fr,select:n8,selectAll:r8,selectChild:lr.selectChild,selectChildren:lr.selectChildren,filter:ZM,merge:QM,selection:i8,transition:b8,call:lr.call,nodes:lr.nodes,node:lr.node,size:lr.size,empty:lr.empty,each:lr.each,on:WM,attr:zM,attrTween:jM,style:c8,styleTween:h8,text:g8,textTween:v8,remove:t8,tween:TM,delay:VM,duration:XM,ease:IM,easeVarying:$M,end:_8,[Symbol.iterator]:lr[Symbol.iterator]};function S8(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var w8={time:null,delay:0,duration:250,ease:S8};function A8(t,r){for(var o;!(o=t.__transition)||!(o=o[r]);)if(!(t=t.parentNode))throw new Error(`transition ${r} not found`);return o}function T8(t){var r,o;t instanceof fr?(r=t._id,t=t._name):(r=x_(),(o=w8).time=C0(),t=t==null?null:t+"");for(var a=this._groups,s=a.length,u=0;u<s;++u)for(var f=a[u],h=f.length,p,m=0;m<h;++m)(p=f[m])&&ac(p,t,r,m,f,o||A8(p,r));return new fr(a,this._parents,t,r)}yl.prototype.interrupt=SM;yl.prototype.transition=T8;const au=t=>()=>t;function C8(t,{sourceEvent:r,target:o,transform:a,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:s}})}function sr(t,r,o){this.k=t,this.x=r,this.y=o}sr.prototype={constructor:sr,scale:function(t){return t===1?this:new sr(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new sr(this.k,this.x+this.k*t,this.y+this.k*r)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var lc=new sr(1,0,0);v_.prototype=sr.prototype;function v_(t){for(;!t.__zoom;)if(!(t=t.parentNode))return lc;return t.__zoom}function Zd(t){t.stopImmediatePropagation()}function Pa(t){t.preventDefault(),t.stopImmediatePropagation()}function N8(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function R8(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function S1(){return this.__zoom||lc}function M8(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function D8(){return navigator.maxTouchPoints||"ontouchstart"in this}function O8(t,r,o){var a=t.invertX(r[0][0])-o[0][0],s=t.invertX(r[1][0])-o[1][0],u=t.invertY(r[0][1])-o[0][1],f=t.invertY(r[1][1])-o[1][1];return t.translate(s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s),f>u?(u+f)/2:Math.min(0,u)||Math.max(0,f))}function b_(){var t=N8,r=R8,o=O8,a=M8,s=D8,u=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],h=250,p=bu,m=rc("start","zoom","end"),y,g,x,_=500,b=150,E=0,C=10;function w(U){U.property("__zoom",S1).on("wheel.zoom",q,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",ae).filter(s).on("touchstart.zoom",V).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",ee).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(U,X,R,H){var F=U.selection?U.selection():U;F.property("__zoom",S1),U!==F?O(U,X,R,H):F.interrupt().each(function(){z(this,arguments).event(H).start().zoom(null,typeof X=="function"?X.apply(this,arguments):X).end()})},w.scaleBy=function(U,X,R,H){w.scaleTo(U,function(){var F=this.__zoom.k,P=typeof X=="function"?X.apply(this,arguments):X;return F*P},R,H)},w.scaleTo=function(U,X,R,H){w.transform(U,function(){var F=r.apply(this,arguments),P=this.__zoom,te=R==null?N(F):typeof R=="function"?R.apply(this,arguments):R,M=P.invert(te),k=typeof X=="function"?X.apply(this,arguments):X;return o(S(D(P,k),te,M),F,f)},R,H)},w.translateBy=function(U,X,R,H){w.transform(U,function(){return o(this.__zoom.translate(typeof X=="function"?X.apply(this,arguments):X,typeof R=="function"?R.apply(this,arguments):R),r.apply(this,arguments),f)},null,H)},w.translateTo=function(U,X,R,H,F){w.transform(U,function(){var P=r.apply(this,arguments),te=this.__zoom,M=H==null?N(P):typeof H=="function"?H.apply(this,arguments):H;return o(lc.translate(M[0],M[1]).scale(te.k).translate(typeof X=="function"?-X.apply(this,arguments):-X,typeof R=="function"?-R.apply(this,arguments):-R),P,f)},H,F)};function D(U,X){return X=Math.max(u[0],Math.min(u[1],X)),X===U.k?U:new sr(X,U.x,U.y)}function S(U,X,R){var H=X[0]-R[0]*U.k,F=X[1]-R[1]*U.k;return H===U.x&&F===U.y?U:new sr(U.k,H,F)}function N(U){return[(+U[0][0]+ +U[1][0])/2,(+U[0][1]+ +U[1][1])/2]}function O(U,X,R,H){U.on("start.zoom",function(){z(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(H).end()}).tween("zoom",function(){var F=this,P=arguments,te=z(F,P).event(H),M=r.apply(F,P),k=R==null?N(M):typeof R=="function"?R.apply(F,P):R,W=Math.max(M[1][0]-M[0][0],M[1][1]-M[0][1]),ne=F.__zoom,se=typeof X=="function"?X.apply(F,P):X,he=p(ne.invert(k).concat(W/ne.k),se.invert(k).concat(W/se.k));return function(ce){if(ce===1)ce=se;else{var ue=he(ce),de=W/ue[2];ce=new sr(de,k[0]-ue[0]*de,k[1]-ue[1]*de)}te.zoom(null,ce)}})}function z(U,X,R){return!R&&U.__zooming||new B(U,X)}function B(U,X){this.that=U,this.args=X,this.active=0,this.sourceEvent=null,this.extent=r.apply(U,X),this.taps=0}B.prototype={event:function(U){return U&&(this.sourceEvent=U),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(U,X){return this.mouse&&U!=="mouse"&&(this.mouse[1]=X.invert(this.mouse[0])),this.touch0&&U!=="touch"&&(this.touch0[1]=X.invert(this.touch0[0])),this.touch1&&U!=="touch"&&(this.touch1[1]=X.invert(this.touch1[0])),this.that.__zoom=X,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(U){var X=Kt(this.that).datum();m.call(U,this.that,new C8(U,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:m}),X)}};function q(U,...X){if(!t.apply(this,arguments))return;var R=z(this,X).event(U),H=this.__zoom,F=Math.max(u[0],Math.min(u[1],H.k*Math.pow(2,a.apply(this,arguments)))),P=yn(U);if(R.wheel)(R.mouse[0][0]!==P[0]||R.mouse[0][1]!==P[1])&&(R.mouse[1]=H.invert(R.mouse[0]=P)),clearTimeout(R.wheel);else{if(H.k===F)return;R.mouse=[P,H.invert(P)],Su(this),R.start()}Pa(U),R.wheel=setTimeout(te,b),R.zoom("mouse",o(S(D(H,F),R.mouse[0],R.mouse[1]),R.extent,f));function te(){R.wheel=null,R.end()}}function I(U,...X){if(x||!t.apply(this,arguments))return;var R=U.currentTarget,H=z(this,X,!0).event(U),F=Kt(U.view).on("mousemove.zoom",k,!0).on("mouseup.zoom",W,!0),P=yn(U,R),te=U.clientX,M=U.clientY;r_(U.view),Zd(U),H.mouse=[P,this.__zoom.invert(P)],Su(this),H.start();function k(ne){if(Pa(ne),!H.moved){var se=ne.clientX-te,he=ne.clientY-M;H.moved=se*se+he*he>E}H.event(ne).zoom("mouse",o(S(H.that.__zoom,H.mouse[0]=yn(ne,R),H.mouse[1]),H.extent,f))}function W(ne){F.on("mousemove.zoom mouseup.zoom",null),o_(ne.view,H.moved),Pa(ne),H.event(ne).end()}}function ae(U,...X){if(t.apply(this,arguments)){var R=this.__zoom,H=yn(U.changedTouches?U.changedTouches[0]:U,this),F=R.invert(H),P=R.k*(U.shiftKey?.5:2),te=o(S(D(R,P),H,F),r.apply(this,X),f);Pa(U),h>0?Kt(this).transition().duration(h).call(O,te,H,U):Kt(this).call(w.transform,te,H,U)}}function V(U,...X){if(t.apply(this,arguments)){var R=U.touches,H=R.length,F=z(this,X,U.changedTouches.length===H).event(U),P,te,M,k;for(Zd(U),te=0;te<H;++te)M=R[te],k=yn(M,this),k=[k,this.__zoom.invert(k),M.identifier],F.touch0?!F.touch1&&F.touch0[2]!==k[2]&&(F.touch1=k,F.taps=0):(F.touch0=k,P=!0,F.taps=1+!!y);y&&(y=clearTimeout(y)),P&&(F.taps<2&&(g=k[0],y=setTimeout(function(){y=null},_)),Su(this),F.start())}}function $(U,...X){if(this.__zooming){var R=z(this,X).event(U),H=U.changedTouches,F=H.length,P,te,M,k;for(Pa(U),P=0;P<F;++P)te=H[P],M=yn(te,this),R.touch0&&R.touch0[2]===te.identifier?R.touch0[0]=M:R.touch1&&R.touch1[2]===te.identifier&&(R.touch1[0]=M);if(te=R.that.__zoom,R.touch1){var W=R.touch0[0],ne=R.touch0[1],se=R.touch1[0],he=R.touch1[1],ce=(ce=se[0]-W[0])*ce+(ce=se[1]-W[1])*ce,ue=(ue=he[0]-ne[0])*ue+(ue=he[1]-ne[1])*ue;te=D(te,Math.sqrt(ce/ue)),M=[(W[0]+se[0])/2,(W[1]+se[1])/2],k=[(ne[0]+he[0])/2,(ne[1]+he[1])/2]}else if(R.touch0)M=R.touch0[0],k=R.touch0[1];else return;R.zoom("touch",o(S(te,M,k),R.extent,f))}}function ee(U,...X){if(this.__zooming){var R=z(this,X).event(U),H=U.changedTouches,F=H.length,P,te;for(Zd(U),x&&clearTimeout(x),x=setTimeout(function(){x=null},_),P=0;P<F;++P)te=H[P],R.touch0&&R.touch0[2]===te.identifier?delete R.touch0:R.touch1&&R.touch1[2]===te.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(te=yn(te,this),Math.hypot(g[0]-te[0],g[1]-te[1])<C)){var M=Kt(this).on("dblclick.zoom");M&&M.apply(this,arguments)}}}return w.wheelDelta=function(U){return arguments.length?(a=typeof U=="function"?U:au(+U),w):a},w.filter=function(U){return arguments.length?(t=typeof U=="function"?U:au(!!U),w):t},w.touchable=function(U){return arguments.length?(s=typeof U=="function"?U:au(!!U),w):s},w.extent=function(U){return arguments.length?(r=typeof U=="function"?U:au([[+U[0][0],+U[0][1]],[+U[1][0],+U[1][1]]]),w):r},w.scaleExtent=function(U){return arguments.length?(u[0]=+U[0],u[1]=+U[1],w):[u[0],u[1]]},w.translateExtent=function(U){return arguments.length?(f[0][0]=+U[0][0],f[1][0]=+U[1][0],f[0][1]=+U[0][1],f[1][1]=+U[1][1],w):[[f[0][0],f[0][1]],[f[1][0],f[1][1]]]},w.constrain=function(U){return arguments.length?(o=U,w):o},w.duration=function(U){return arguments.length?(h=+U,w):h},w.interpolate=function(U){return arguments.length?(p=U,w):p},w.on=function(){var U=m.on.apply(m,arguments);return U===m?w:U},w.clickDistance=function(U){return arguments.length?(E=(U=+U)*U,w):Math.sqrt(E)},w.tapDistance=function(U){return arguments.length?(C=+U,w):C},w}const Un={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:r,sourceHandle:o,targetHandle:a})=>`Couldn't create edge for ${t} handle id: "${t==="source"?o:a}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ll=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],__=["Enter"," ","Escape"],E_={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:r,y:o})=>`Moved selected node ${t}. New position, x: ${r}, y: ${o}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ji;(function(t){t.Strict="strict",t.Loose="loose"})(ji||(ji={}));var Mo;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Mo||(Mo={}));var sl;(function(t){t.Partial="partial",t.Full="full"})(sl||(sl={}));const S_={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Yr;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Yr||(Yr={}));var ju;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(ju||(ju={}));var xe;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(xe||(xe={}));const w1={[xe.Left]:xe.Right,[xe.Right]:xe.Left,[xe.Top]:xe.Bottom,[xe.Bottom]:xe.Top};function w_(t){return t===null?null:t?"valid":"invalid"}const A_=t=>"id"in t&&"source"in t&&"target"in t,z8=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),M0=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),T_=(t,r,o)=>{if(!t.id)return[];const a=new Set;return o.forEach(s=>{s.source===t.id&&a.add(s.target)}),r.filter(s=>a.has(s.id))},vl=(t,r=[0,0])=>{const{width:o,height:a}=dr(t),s=t.origin??r,u=o*s[0],f=a*s[1];return{x:t.position.x-u,y:t.position.y-f}},B8=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const o=t.reduce((a,s)=>{const u=typeof s=="string";let f=!r.nodeLookup&&!u?s:void 0;r.nodeLookup&&(f=u?r.nodeLookup.get(s):M0(s)?s:r.nodeLookup.get(s.id));const h=f?Fu(f,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return sc(a,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return uc(o)},bl=(t,r={})=>{let o={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return t.forEach(s=>{(r.filter===void 0||r.filter(s))&&(o=sc(o,Fu(s)),a=!0)}),a?uc(o):{x:0,y:0,width:0,height:0}},D0=(t,r,[o,a,s]=[0,0,1],u=!1,f=!1)=>{const h={...El(r,[o,a,s]),width:r.width/s,height:r.height/s},p=[];for(const m of t.values()){const{measured:y,selectable:g=!0,hidden:x=!1}=m;if(f&&!g||x)continue;const _=y.width??m.width??m.initialWidth??null,b=y.height??m.height??m.initialHeight??null,E=ul(h,ki(m)),C=(_??0)*(b??0),w=u&&E>0;(!m.internals.handleBounds||w||E>=C||m.dragging)&&p.push(m)}return p},U8=(t,r)=>{const o=new Set;return t.forEach(a=>{o.add(a.id)}),r.filter(a=>o.has(a.source)||o.has(a.target))};function H8(t,r){const o=new Map,a=r?.nodes?new Set(r.nodes.map(s=>s.id)):null;return t.forEach(s=>{s.measured.width&&s.measured.height&&(r?.includeHiddenNodes||!s.hidden)&&(!a||a.has(s.id))&&o.set(s.id,s)}),o}async function L8({nodes:t,width:r,height:o,panZoom:a,minZoom:s,maxZoom:u},f){if(t.size===0)return Promise.resolve(!0);const h=H8(t,f),p=bl(h),m=O0(p,r,o,f?.minZoom??s,f?.maxZoom??u,f?.padding??.1);return await a.setViewport(m,{duration:f?.duration,ease:f?.ease,interpolate:f?.interpolate}),Promise.resolve(!0)}function C_({nodeId:t,nextPosition:r,nodeLookup:o,nodeOrigin:a=[0,0],nodeExtent:s,onError:u}){const f=o.get(t),h=f.parentId?o.get(f.parentId):void 0,{x:p,y:m}=h?h.internals.positionAbsolute:{x:0,y:0},y=f.origin??a;let g=f.extent||s;if(f.extent==="parent"&&!f.expandParent)if(!h)u?.("005",Un.error005());else{const _=h.measured.width,b=h.measured.height;_&&b&&(g=[[p,m],[p+_,m+b]])}else h&&Vi(f.extent)&&(g=[[f.extent[0][0]+p,f.extent[0][1]+m],[f.extent[1][0]+p,f.extent[1][1]+m]]);const x=Vi(g)?Uo(r,g,f.measured):r;return(f.measured.width===void 0||f.measured.height===void 0)&&u?.("015",Un.error015()),{position:{x:x.x-p+(f.measured.width??0)*y[0],y:x.y-m+(f.measured.height??0)*y[1]},positionAbsolute:x}}async function j8({nodesToRemove:t=[],edgesToRemove:r=[],nodes:o,edges:a,onBeforeDelete:s}){const u=new Set(t.map(x=>x.id)),f=[];for(const x of o){if(x.deletable===!1)continue;const _=u.has(x.id),b=!_&&x.parentId&&f.find(E=>E.id===x.parentId);(_||b)&&f.push(x)}const h=new Set(r.map(x=>x.id)),p=a.filter(x=>x.deletable!==!1),y=U8(f,p);for(const x of p)h.has(x.id)&&!y.find(b=>b.id===x.id)&&y.push(x);if(!s)return{edges:y,nodes:f};const g=await s({nodes:f,edges:y});return typeof g=="boolean"?g?{edges:y,nodes:f}:{edges:[],nodes:[]}:g}const Fi=(t,r=0,o=1)=>Math.min(Math.max(t,r),o),Uo=(t={x:0,y:0},r,o)=>({x:Fi(t.x,r[0][0],r[1][0]-(o?.width??0)),y:Fi(t.y,r[0][1],r[1][1]-(o?.height??0))});function N_(t,r,o){const{width:a,height:s}=dr(o),{x:u,y:f}=o.internals.positionAbsolute;return Uo(t,[[u,f],[u+a,f+s]],r)}const A1=(t,r,o)=>t<r?Fi(Math.abs(t-r),1,r)/r:t>o?-Fi(Math.abs(t-o),1,r)/r:0,R_=(t,r,o=15,a=40)=>{const s=A1(t.x,a,r.width-a)*o,u=A1(t.y,a,r.height-a)*o;return[s,u]},sc=(t,r)=>({x:Math.min(t.x,r.x),y:Math.min(t.y,r.y),x2:Math.max(t.x2,r.x2),y2:Math.max(t.y2,r.y2)}),Mh=({x:t,y:r,width:o,height:a})=>({x:t,y:r,x2:t+o,y2:r+a}),uc=({x:t,y:r,x2:o,y2:a})=>({x:t,y:r,width:o-t,height:a-r}),ki=(t,r=[0,0])=>{const{x:o,y:a}=M0(t)?t.internals.positionAbsolute:vl(t,r);return{x:o,y:a,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},Fu=(t,r=[0,0])=>{const{x:o,y:a}=M0(t)?t.internals.positionAbsolute:vl(t,r);return{x:o,y:a,x2:o+(t.measured?.width??t.width??t.initialWidth??0),y2:a+(t.measured?.height??t.height??t.initialHeight??0)}},M_=(t,r)=>uc(sc(Mh(t),Mh(r))),ul=(t,r)=>{const o=Math.max(0,Math.min(t.x+t.width,r.x+r.width)-Math.max(t.x,r.x)),a=Math.max(0,Math.min(t.y+t.height,r.y+r.height)-Math.max(t.y,r.y));return Math.ceil(o*a)},T1=t=>vn(t.width)&&vn(t.height)&&vn(t.x)&&vn(t.y),vn=t=>!isNaN(t)&&isFinite(t),F8=(t,r)=>{},_l=(t,r=[1,1])=>({x:r[0]*Math.round(t.x/r[0]),y:r[1]*Math.round(t.y/r[1])}),El=({x:t,y:r},[o,a,s],u=!1,f=[1,1])=>{const h={x:(t-o)/s,y:(r-a)/s};return u?_l(h,f):h},ku=({x:t,y:r},[o,a,s])=>({x:t*s+o,y:r*s+a});function Ri(t,r){if(typeof t=="number")return Math.floor((r-r/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const o=parseFloat(t);if(!Number.isNaN(o))return Math.floor(o)}if(typeof t=="string"&&t.endsWith("%")){const o=parseFloat(t);if(!Number.isNaN(o))return Math.floor(r*o*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function k8(t,r,o){if(typeof t=="string"||typeof t=="number"){const a=Ri(t,o),s=Ri(t,r);return{top:a,right:s,bottom:a,left:s,x:s*2,y:a*2}}if(typeof t=="object"){const a=Ri(t.top??t.y??0,o),s=Ri(t.bottom??t.y??0,o),u=Ri(t.left??t.x??0,r),f=Ri(t.right??t.x??0,r);return{top:a,right:f,bottom:s,left:u,x:u+f,y:a+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function V8(t,r,o,a,s,u){const{x:f,y:h}=ku(t,[r,o,a]),{x:p,y:m}=ku({x:t.x+t.width,y:t.y+t.height},[r,o,a]),y=s-p,g=u-m;return{left:Math.floor(f),top:Math.floor(h),right:Math.floor(y),bottom:Math.floor(g)}}const O0=(t,r,o,a,s,u)=>{const f=k8(u,r,o),h=(r-f.x)/t.width,p=(o-f.y)/t.height,m=Math.min(h,p),y=Fi(m,a,s),g=t.x+t.width/2,x=t.y+t.height/2,_=r/2-g*y,b=o/2-x*y,E=V8(t,_,b,y,r,o),C={left:Math.min(E.left-f.left,0),top:Math.min(E.top-f.top,0),right:Math.min(E.right-f.right,0),bottom:Math.min(E.bottom-f.bottom,0)};return{x:_-C.left+C.right,y:b-C.top+C.bottom,zoom:y}},cl=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Vi(t){return t!=null&&t!=="parent"}function dr(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function D_(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function O_(t,r={width:0,height:0},o,a,s){const u={...t},f=a.get(o);if(f){const h=f.origin||s;u.x+=f.internals.positionAbsolute.x-(r.width??0)*h[0],u.y+=f.internals.positionAbsolute.y-(r.height??0)*h[1]}return u}function C1(t,r){if(t.size!==r.size)return!1;for(const o of t)if(!r.has(o))return!1;return!0}function G8(){let t,r;return{promise:new Promise((a,s)=>{t=a,r=s}),resolve:t,reject:r}}function q8(t){return{...E_,...t||{}}}function Ja(t,{snapGrid:r=[0,0],snapToGrid:o=!1,transform:a,containerBounds:s}){const{x:u,y:f}=bn(t),h=El({x:u-(s?.left??0),y:f-(s?.top??0)},a),{x:p,y:m}=o?_l(h,r):h;return{xSnapped:p,ySnapped:m,...h}}const z0=t=>({width:t.offsetWidth,height:t.offsetHeight}),z_=t=>t?.getRootNode?.()||window?.document,X8=["INPUT","SELECT","TEXTAREA"];function B_(t){const r=t.composedPath?.()?.[0]||t.target;return r?.nodeType!==1?!1:X8.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const U_=t=>"clientX"in t,bn=(t,r)=>{const o=U_(t),a=o?t.clientX:t.touches?.[0].clientX,s=o?t.clientY:t.touches?.[0].clientY;return{x:a-(r?.left??0),y:s-(r?.top??0)}},N1=(t,r,o,a,s)=>{const u=r.querySelectorAll(`.${t}`);return!u||!u.length?null:Array.from(u).map(f=>{const h=f.getBoundingClientRect();return{id:f.getAttribute("data-handleid"),type:t,nodeId:s,position:f.getAttribute("data-handlepos"),x:(h.left-o.left)/a,y:(h.top-o.top)/a,...z0(f)}})};function H_({sourceX:t,sourceY:r,targetX:o,targetY:a,sourceControlX:s,sourceControlY:u,targetControlX:f,targetControlY:h}){const p=t*.125+s*.375+f*.375+o*.125,m=r*.125+u*.375+h*.375+a*.125,y=Math.abs(p-t),g=Math.abs(m-r);return[p,m,y,g]}function lu(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function R1({pos:t,x1:r,y1:o,x2:a,y2:s,c:u}){switch(t){case xe.Left:return[r-lu(r-a,u),o];case xe.Right:return[r+lu(a-r,u),o];case xe.Top:return[r,o-lu(o-s,u)];case xe.Bottom:return[r,o+lu(s-o,u)]}}function cc({sourceX:t,sourceY:r,sourcePosition:o=xe.Bottom,targetX:a,targetY:s,targetPosition:u=xe.Top,curvature:f=.25}){const[h,p]=R1({pos:o,x1:t,y1:r,x2:a,y2:s,c:f}),[m,y]=R1({pos:u,x1:a,y1:s,x2:t,y2:r,c:f}),[g,x,_,b]=H_({sourceX:t,sourceY:r,targetX:a,targetY:s,sourceControlX:h,sourceControlY:p,targetControlX:m,targetControlY:y});return[`M${t},${r} C${h},${p} ${m},${y} ${a},${s}`,g,x,_,b]}function L_({sourceX:t,sourceY:r,targetX:o,targetY:a}){const s=Math.abs(o-t)/2,u=o<t?o+s:o-s,f=Math.abs(a-r)/2,h=a<r?a+f:a-f;return[u,h,s,f]}function Y8({sourceNode:t,targetNode:r,selected:o=!1,zIndex:a=0,elevateOnSelect:s=!1,zIndexMode:u="basic"}){if(u==="manual")return a;const f=s&&o?a+1e3:a,h=Math.max(t.parentId||s&&t.selected?t.internals.z:0,r.parentId||s&&r.selected?r.internals.z:0);return f+h}function I8({sourceNode:t,targetNode:r,width:o,height:a,transform:s}){const u=sc(Fu(t),Fu(r));u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const f={x:-s[0]/s[2],y:-s[1]/s[2],width:o/s[2],height:a/s[2]};return ul(f,uc(u))>0}const P8=({source:t,sourceHandle:r,target:o,targetHandle:a})=>`xy-edge__${t}${r||""}-${o}${a||""}`,$8=(t,r)=>r.some(o=>o.source===t.source&&o.target===t.target&&(o.sourceHandle===t.sourceHandle||!o.sourceHandle&&!t.sourceHandle)&&(o.targetHandle===t.targetHandle||!o.targetHandle&&!t.targetHandle)),Dh=(t,r,o={})=>{if(!t.source||!t.target)return r;const a=o.getEdgeId||P8;let s;return A_(t)?s={...t}:s={...t,id:a(t)},$8(s,r)?r:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,r.concat(s))};function j_({sourceX:t,sourceY:r,targetX:o,targetY:a}){const[s,u,f,h]=L_({sourceX:t,sourceY:r,targetX:o,targetY:a});return[`M ${t},${r}L ${o},${a}`,s,u,f,h]}const M1={[xe.Left]:{x:-1,y:0},[xe.Right]:{x:1,y:0},[xe.Top]:{x:0,y:-1},[xe.Bottom]:{x:0,y:1}},Z8=({source:t,sourcePosition:r=xe.Bottom,target:o})=>r===xe.Left||r===xe.Right?t.x<o.x?{x:1,y:0}:{x:-1,y:0}:t.y<o.y?{x:0,y:1}:{x:0,y:-1},D1=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function Q8({source:t,sourcePosition:r=xe.Bottom,target:o,targetPosition:a=xe.Top,center:s,offset:u,stepPosition:f}){const h=M1[r],p=M1[a],m={x:t.x+h.x*u,y:t.y+h.y*u},y={x:o.x+p.x*u,y:o.y+p.y*u},g=Z8({source:m,sourcePosition:r,target:y}),x=g.x!==0?"x":"y",_=g[x];let b=[],E,C;const w={x:0,y:0},D={x:0,y:0},[,,S,N]=L_({sourceX:t.x,sourceY:t.y,targetX:o.x,targetY:o.y});if(h[x]*p[x]===-1){x==="x"?(E=s.x??m.x+(y.x-m.x)*f,C=s.y??(m.y+y.y)/2):(E=s.x??(m.x+y.x)/2,C=s.y??m.y+(y.y-m.y)*f);const z=[{x:E,y:m.y},{x:E,y:y.y}],B=[{x:m.x,y:C},{x:y.x,y:C}];h[x]===_?b=x==="x"?z:B:b=x==="x"?B:z}else{const z=[{x:m.x,y:y.y}],B=[{x:y.x,y:m.y}];if(x==="x"?b=h.x===_?B:z:b=h.y===_?z:B,r===a){const $=Math.abs(t[x]-o[x]);if($<=u){const ee=Math.min(u-1,u-$);h[x]===_?w[x]=(m[x]>t[x]?-1:1)*ee:D[x]=(y[x]>o[x]?-1:1)*ee}}if(r!==a){const $=x==="x"?"y":"x",ee=h[x]===p[$],U=m[$]>y[$],X=m[$]<y[$];(h[x]===1&&(!ee&&U||ee&&X)||h[x]!==1&&(!ee&&X||ee&&U))&&(b=x==="x"?z:B)}const q={x:m.x+w.x,y:m.y+w.y},I={x:y.x+D.x,y:y.y+D.y},ae=Math.max(Math.abs(q.x-b[0].x),Math.abs(I.x-b[0].x)),V=Math.max(Math.abs(q.y-b[0].y),Math.abs(I.y-b[0].y));ae>=V?(E=(q.x+I.x)/2,C=b[0].y):(E=b[0].x,C=(q.y+I.y)/2)}return[[t,{x:m.x+w.x,y:m.y+w.y},...b,{x:y.x+D.x,y:y.y+D.y},o],E,C,S,N]}function K8(t,r,o,a){const s=Math.min(D1(t,r)/2,D1(r,o)/2,a),{x:u,y:f}=r;if(t.x===u&&u===o.x||t.y===f&&f===o.y)return`L${u} ${f}`;if(t.y===f){const m=t.x<o.x?-1:1,y=t.y<o.y?1:-1;return`L ${u+s*m},${f}Q ${u},${f} ${u},${f+s*y}`}const h=t.x<o.x?1:-1,p=t.y<o.y?-1:1;return`L ${u},${f+s*p}Q ${u},${f} ${u+s*h},${f}`}function Oh({sourceX:t,sourceY:r,sourcePosition:o=xe.Bottom,targetX:a,targetY:s,targetPosition:u=xe.Top,borderRadius:f=5,centerX:h,centerY:p,offset:m=20,stepPosition:y=.5}){const[g,x,_,b,E]=Q8({source:{x:t,y:r},sourcePosition:o,target:{x:a,y:s},targetPosition:u,center:{x:h,y:p},offset:m,stepPosition:y});return[g.reduce((w,D,S)=>{let N="";return S>0&&S<g.length-1?N=K8(g[S-1],D,g[S+1],f):N=`${S===0?"M":"L"}${D.x} ${D.y}`,w+=N,w},""),x,_,b,E]}function O1(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function J8(t){const{sourceNode:r,targetNode:o}=t;if(!O1(r)||!O1(o))return null;const a=r.internals.handleBounds||z1(r.handles),s=o.internals.handleBounds||z1(o.handles),u=B1(a?.source??[],t.sourceHandle),f=B1(t.connectionMode===ji.Strict?s?.target??[]:(s?.target??[]).concat(s?.source??[]),t.targetHandle);if(!u||!f)return t.onError?.("008",Un.error008(u?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const h=u?.position||xe.Bottom,p=f?.position||xe.Top,m=Ho(r,u,h),y=Ho(o,f,p);return{sourceX:m.x,sourceY:m.y,targetX:y.x,targetY:y.y,sourcePosition:h,targetPosition:p}}function z1(t){if(!t)return null;const r=[],o=[];for(const a of t)a.width=a.width??1,a.height=a.height??1,a.type==="source"?r.push(a):a.type==="target"&&o.push(a);return{source:r,target:o}}function Ho(t,r,o=xe.Left,a=!1){const s=(r?.x??0)+t.internals.positionAbsolute.x,u=(r?.y??0)+t.internals.positionAbsolute.y,{width:f,height:h}=r??dr(t);if(a)return{x:s+f/2,y:u+h/2};switch(r?.position??o){case xe.Top:return{x:s+f/2,y:u};case xe.Right:return{x:s+f,y:u+h/2};case xe.Bottom:return{x:s+f/2,y:u+h};case xe.Left:return{x:s,y:u+h/2}}}function B1(t,r){return t&&(r?t.find(o=>o.id===r):t[0])||null}function zh(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(a=>`${a}=${t[a]}`).join("&")}`:""}function W8(t,{id:r,defaultColor:o,defaultMarkerStart:a,defaultMarkerEnd:s}){const u=new Set;return t.reduce((f,h)=>([h.markerStart||a,h.markerEnd||s].forEach(p=>{if(p&&typeof p=="object"){const m=zh(p,r);u.has(m)||(f.push({id:m,color:p.color||o,...p}),u.add(m))}}),f),[]).sort((f,h)=>f.id.localeCompare(h.id))}const F_=1e3,eD=10,B0={nodeOrigin:[0,0],nodeExtent:ll,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},tD={...B0,checkEquality:!0};function U0(t,r){const o={...t};for(const a in r)r[a]!==void 0&&(o[a]=r[a]);return o}function nD(t,r,o){const a=U0(B0,o);for(const s of t.values())if(s.parentId)L0(s,t,r,a);else{const u=vl(s,a.nodeOrigin),f=Vi(s.extent)?s.extent:a.nodeExtent,h=Uo(u,f,dr(s));s.internals.positionAbsolute=h}}function rD(t,r){if(!t.handles)return t.measured?r?.internals.handleBounds:void 0;const o=[],a=[];for(const s of t.handles){const u={id:s.id,width:s.width??1,height:s.height??1,nodeId:t.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?o.push(u):s.type==="target"&&a.push(u)}return{source:o,target:a}}function H0(t){return t==="manual"}function Bh(t,r,o,a={}){const s=U0(tD,a),u={i:0},f=new Map(r),h=s?.elevateNodesOnSelect&&!H0(s.zIndexMode)?F_:0;let p=t.length>0;r.clear(),o.clear();for(const m of t){let y=f.get(m.id);if(s.checkEquality&&m===y?.internals.userNode)r.set(m.id,y);else{const g=vl(m,s.nodeOrigin),x=Vi(m.extent)?m.extent:s.nodeExtent,_=Uo(g,x,dr(m));y={...s.defaults,...m,measured:{width:m.measured?.width,height:m.measured?.height},internals:{positionAbsolute:_,handleBounds:rD(m,y),z:k_(m,h,s.zIndexMode),userNode:m}},r.set(m.id,y)}(y.measured===void 0||y.measured.width===void 0||y.measured.height===void 0)&&!y.hidden&&(p=!1),m.parentId&&L0(y,r,o,a,u)}return p}function oD(t,r){if(!t.parentId)return;const o=r.get(t.parentId);o?o.set(t.id,t):r.set(t.parentId,new Map([[t.id,t]]))}function L0(t,r,o,a,s){const{elevateNodesOnSelect:u,nodeOrigin:f,nodeExtent:h,zIndexMode:p}=U0(B0,a),m=t.parentId,y=r.get(m);if(!y){console.warn(`Parent node ${m} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}oD(t,o),s&&!y.parentId&&y.internals.rootParentIndex===void 0&&p==="auto"&&(y.internals.rootParentIndex=++s.i,y.internals.z=y.internals.z+s.i*eD),s&&y.internals.rootParentIndex!==void 0&&(s.i=y.internals.rootParentIndex);const g=u&&!H0(p)?F_:0,{x,y:_,z:b}=iD(t,y,f,h,g,p),{positionAbsolute:E}=t.internals,C=x!==E.x||_!==E.y;(C||b!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:C?{x,y:_}:E,z:b}})}function k_(t,r,o){const a=vn(t.zIndex)?t.zIndex:0;return H0(o)?a:a+(t.selected?r:0)}function iD(t,r,o,a,s,u){const{x:f,y:h}=r.internals.positionAbsolute,p=dr(t),m=vl(t,o),y=Vi(t.extent)?Uo(m,t.extent,p):m;let g=Uo({x:f+y.x,y:h+y.y},a,p);t.extent==="parent"&&(g=N_(g,p,r));const x=k_(t,s,u),_=r.internals.z??0;return{x:g.x,y:g.y,z:_>=x?_+1:x}}function j0(t,r,o,a=[0,0]){const s=[],u=new Map;for(const f of t){const h=r.get(f.parentId);if(!h)continue;const p=u.get(f.parentId)?.expandedRect??ki(h),m=M_(p,f.rect);u.set(f.parentId,{expandedRect:m,parent:h})}return u.size>0&&u.forEach(({expandedRect:f,parent:h},p)=>{const m=h.internals.positionAbsolute,y=dr(h),g=h.origin??a,x=f.x<m.x?Math.round(Math.abs(m.x-f.x)):0,_=f.y<m.y?Math.round(Math.abs(m.y-f.y)):0,b=Math.max(y.width,Math.round(f.width)),E=Math.max(y.height,Math.round(f.height)),C=(b-y.width)*g[0],w=(E-y.height)*g[1];(x>0||_>0||C||w)&&(s.push({id:p,type:"position",position:{x:h.position.x-x+C,y:h.position.y-_+w}}),o.get(p)?.forEach(D=>{t.some(S=>S.id===D.id)||s.push({id:D.id,type:"position",position:{x:D.position.x+x,y:D.position.y+_}})})),(y.width<f.width||y.height<f.height||x||_)&&s.push({id:p,type:"dimensions",setAttributes:!0,dimensions:{width:b+(x?g[0]*x-C:0),height:E+(_?g[1]*_-w:0)}})}),s}function aD(t,r,o,a,s,u,f){const h=a?.querySelector(".xyflow__viewport");let p=!1;if(!h)return{changes:[],updatedInternals:p};const m=[],y=window.getComputedStyle(h),{m22:g}=new window.DOMMatrixReadOnly(y.transform),x=[];for(const _ of t.values()){const b=r.get(_.id);if(!b)continue;if(b.hidden){r.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),p=!0;continue}const E=z0(_.nodeElement),C=b.measured.width!==E.width||b.measured.height!==E.height;if(!!(E.width&&E.height&&(C||!b.internals.handleBounds||_.force))){const D=_.nodeElement.getBoundingClientRect(),S=Vi(b.extent)?b.extent:u;let{positionAbsolute:N}=b.internals;b.parentId&&b.extent==="parent"?N=N_(N,E,r.get(b.parentId)):S&&(N=Uo(N,S,E));const O={...b,measured:E,internals:{...b.internals,positionAbsolute:N,handleBounds:{source:N1("source",_.nodeElement,D,g,b.id),target:N1("target",_.nodeElement,D,g,b.id)}}};r.set(b.id,O),b.parentId&&L0(O,r,o,{nodeOrigin:s,zIndexMode:f}),p=!0,C&&(m.push({id:b.id,type:"dimensions",dimensions:E}),b.expandParent&&b.parentId&&x.push({id:b.id,parentId:b.parentId,rect:ki(O,s)}))}}if(x.length>0){const _=j0(x,r,o,s);m.push(..._)}return{changes:m,updatedInternals:p}}async function lD({delta:t,panZoom:r,transform:o,translateExtent:a,width:s,height:u}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const f=await r.setViewportConstrained({x:o[0]+t.x,y:o[1]+t.y,zoom:o[2]},[[0,0],[s,u]],a),h=!!f&&(f.x!==o[0]||f.y!==o[1]||f.k!==o[2]);return Promise.resolve(h)}function U1(t,r,o,a,s,u){let f=s;const h=a.get(f)||new Map;a.set(f,h.set(o,r)),f=`${s}-${t}`;const p=a.get(f)||new Map;if(a.set(f,p.set(o,r)),u){f=`${s}-${t}-${u}`;const m=a.get(f)||new Map;a.set(f,m.set(o,r))}}function V_(t,r,o){t.clear(),r.clear();for(const a of o){const{source:s,target:u,sourceHandle:f=null,targetHandle:h=null}=a,p={edgeId:a.id,source:s,target:u,sourceHandle:f,targetHandle:h},m=`${s}-${f}--${u}-${h}`,y=`${u}-${h}--${s}-${f}`;U1("source",p,y,t,s,f),U1("target",p,m,t,u,h),r.set(a.id,a)}}function G_(t,r){if(!t.parentId)return!1;const o=r.get(t.parentId);return o?o.selected?!0:G_(o,r):!1}function H1(t,r,o){let a=t;do{if(a?.matches?.(r))return!0;if(a===o)return!1;a=a?.parentElement}while(a);return!1}function sD(t,r,o,a){const s=new Map;for(const[u,f]of t)if((f.selected||f.id===a)&&(!f.parentId||!G_(f,t))&&(f.draggable||r&&typeof f.draggable>"u")){const h=t.get(u);h&&s.set(u,{id:u,position:h.position||{x:0,y:0},distance:{x:o.x-h.internals.positionAbsolute.x,y:o.y-h.internals.positionAbsolute.y},extent:h.extent,parentId:h.parentId,origin:h.origin,expandParent:h.expandParent,internals:{positionAbsolute:h.internals.positionAbsolute||{x:0,y:0}},measured:{width:h.measured.width??0,height:h.measured.height??0}})}return s}function Qd({nodeId:t,dragItems:r,nodeLookup:o,dragging:a=!0}){const s=[];for(const[f,h]of r){const p=o.get(f)?.internals.userNode;p&&s.push({...p,position:h.position,dragging:a})}if(!t)return[s[0],s];const u=o.get(t)?.internals.userNode;return[u?{...u,position:r.get(t)?.position||u.position,dragging:a}:s[0],s]}function uD({dragItems:t,snapGrid:r,x:o,y:a}){const s=t.values().next().value;if(!s)return null;const u={x:o-s.distance.x,y:a-s.distance.y},f=_l(u,r);return{x:f.x-u.x,y:f.y-u.y}}function cD({onNodeMouseDown:t,getStoreItems:r,onDragStart:o,onDrag:a,onDragStop:s}){let u={x:null,y:null},f=0,h=new Map,p=!1,m={x:0,y:0},y=null,g=!1,x=null,_=!1,b=!1,E=null;function C({noDragClassName:D,handleSelector:S,domNode:N,isSelectable:O,nodeId:z,nodeClickDistance:B=0}){x=Kt(N);function q({x:$,y:ee}){const{nodeLookup:U,nodeExtent:X,snapGrid:R,snapToGrid:H,nodeOrigin:F,onNodeDrag:P,onSelectionDrag:te,onError:M,updateNodePositions:k}=r();u={x:$,y:ee};let W=!1;const ne=h.size>1,se=ne&&X?Mh(bl(h)):null,he=ne&&H?uD({dragItems:h,snapGrid:R,x:$,y:ee}):null;for(const[ce,ue]of h){if(!U.has(ce))continue;let de={x:$-ue.distance.x,y:ee-ue.distance.y};H&&(de=he?{x:Math.round(de.x+he.x),y:Math.round(de.y+he.y)}:_l(de,R));let ge=null;if(ne&&X&&!ue.extent&&se){const{positionAbsolute:Ee}=ue.internals,oe=Ee.x-se.x+X[0][0],fe=Ee.x+ue.measured.width-se.x2+X[1][0],me=Ee.y-se.y+X[0][1],Ce=Ee.y+ue.measured.height-se.y2+X[1][1];ge=[[oe,me],[fe,Ce]]}const{position:Se,positionAbsolute:be}=C_({nodeId:ce,nextPosition:de,nodeLookup:U,nodeExtent:ge||X,nodeOrigin:F,onError:M});W=W||ue.position.x!==Se.x||ue.position.y!==Se.y,ue.position=Se,ue.internals.positionAbsolute=be}if(b=b||W,!!W&&(k(h,!0),E&&(a||P||!z&&te))){const[ce,ue]=Qd({nodeId:z,dragItems:h,nodeLookup:U});a?.(E,h,ce,ue),P?.(E,ce,ue),z||te?.(E,ue)}}async function I(){if(!y)return;const{transform:$,panBy:ee,autoPanSpeed:U,autoPanOnNodeDrag:X}=r();if(!X){p=!1,cancelAnimationFrame(f);return}const[R,H]=R_(m,y,U);(R!==0||H!==0)&&(u.x=(u.x??0)-R/$[2],u.y=(u.y??0)-H/$[2],await ee({x:R,y:H})&&q(u)),f=requestAnimationFrame(I)}function ae($){const{nodeLookup:ee,multiSelectionActive:U,nodesDraggable:X,transform:R,snapGrid:H,snapToGrid:F,selectNodesOnDrag:P,onNodeDragStart:te,onSelectionDragStart:M,unselectNodesAndEdges:k}=r();g=!0,(!P||!O)&&!U&&z&&(ee.get(z)?.selected||k()),O&&P&&z&&t?.(z);const W=Ja($.sourceEvent,{transform:R,snapGrid:H,snapToGrid:F,containerBounds:y});if(u=W,h=sD(ee,X,W,z),h.size>0&&(o||te||!z&&M)){const[ne,se]=Qd({nodeId:z,dragItems:h,nodeLookup:ee});o?.($.sourceEvent,h,ne,se),te?.($.sourceEvent,ne,se),z||M?.($.sourceEvent,se)}}const V=i_().clickDistance(B).on("start",$=>{const{domNode:ee,nodeDragThreshold:U,transform:X,snapGrid:R,snapToGrid:H}=r();y=ee?.getBoundingClientRect()||null,_=!1,b=!1,E=$.sourceEvent,U===0&&ae($),u=Ja($.sourceEvent,{transform:X,snapGrid:R,snapToGrid:H,containerBounds:y}),m=bn($.sourceEvent,y)}).on("drag",$=>{const{autoPanOnNodeDrag:ee,transform:U,snapGrid:X,snapToGrid:R,nodeDragThreshold:H,nodeLookup:F}=r(),P=Ja($.sourceEvent,{transform:U,snapGrid:X,snapToGrid:R,containerBounds:y});if(E=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||z&&!F.has(z))&&(_=!0),!_){if(!p&&ee&&g&&(p=!0,I()),!g){const te=bn($.sourceEvent,y),M=te.x-m.x,k=te.y-m.y;Math.sqrt(M*M+k*k)>H&&ae($)}(u.x!==P.xSnapped||u.y!==P.ySnapped)&&h&&g&&(m=bn($.sourceEvent,y),q(P))}}).on("end",$=>{if(!(!g||_)&&(p=!1,g=!1,cancelAnimationFrame(f),h.size>0)){const{nodeLookup:ee,updateNodePositions:U,onNodeDragStop:X,onSelectionDragStop:R}=r();if(b&&(U(h,!1),b=!1),s||X||!z&&R){const[H,F]=Qd({nodeId:z,dragItems:h,nodeLookup:ee,dragging:!1});s?.($.sourceEvent,h,H,F),X?.($.sourceEvent,H,F),z||R?.($.sourceEvent,F)}}}).filter($=>{const ee=$.target;return!$.button&&(!D||!H1(ee,`.${D}`,N))&&(!S||H1(ee,S,N))});x.call(V)}function w(){x?.on(".drag",null)}return{update:C,destroy:w}}function fD(t,r,o){const a=[],s={x:t.x-o,y:t.y-o,width:o*2,height:o*2};for(const u of r.values())ul(s,ki(u))>0&&a.push(u);return a}const dD=250;function hD(t,r,o,a){let s=[],u=1/0;const f=fD(t,o,r+dD);for(const h of f){const p=[...h.internals.handleBounds?.source??[],...h.internals.handleBounds?.target??[]];for(const m of p){if(a.nodeId===m.nodeId&&a.type===m.type&&a.id===m.id)continue;const{x:y,y:g}=Ho(h,m,m.position,!0),x=Math.sqrt(Math.pow(y-t.x,2)+Math.pow(g-t.y,2));x>r||(x<u?(s=[{...m,x:y,y:g}],u=x):x===u&&s.push({...m,x:y,y:g}))}}if(!s.length)return null;if(s.length>1){const h=a.type==="source"?"target":"source";return s.find(p=>p.type===h)??s[0]}return s[0]}function q_(t,r,o,a,s,u=!1){const f=a.get(t);if(!f)return null;const h=s==="strict"?f.internals.handleBounds?.[r]:[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]],p=(o?h?.find(m=>m.id===o):h?.[0])??null;return p&&u?{...p,...Ho(f,p,p.position,!0)}:p}function X_(t,r){return t||(r?.classList.contains("target")?"target":r?.classList.contains("source")?"source":null)}function mD(t,r){let o=null;return r?o=!0:t&&!r&&(o=!1),o}const Y_=()=>!0;function pD(t,{connectionMode:r,connectionRadius:o,handleId:a,nodeId:s,edgeUpdaterType:u,isTarget:f,domNode:h,nodeLookup:p,lib:m,autoPanOnConnect:y,flowId:g,panBy:x,cancelConnection:_,onConnectStart:b,onConnect:E,onConnectEnd:C,isValidConnection:w=Y_,onReconnectEnd:D,updateConnection:S,getTransform:N,getFromHandle:O,autoPanSpeed:z,dragThreshold:B=1,handleDomNode:q}){const I=z_(t.target);let ae=0,V;const{x:$,y:ee}=bn(t),U=X_(u,q),X=h?.getBoundingClientRect();let R=!1;if(!X||!U)return;const H=q_(s,U,a,p,r);if(!H)return;let F=bn(t,X),P=!1,te=null,M=!1,k=null;function W(){if(!y||!X)return;const[Se,be]=R_(F,X,z);x({x:Se,y:be}),ae=requestAnimationFrame(W)}const ne={...H,nodeId:s,type:U,position:H.position},se=p.get(s);let ce={inProgress:!0,isValid:null,from:Ho(se,ne,xe.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:se,to:F,toHandle:null,toPosition:w1[ne.position],toNode:null,pointer:F};function ue(){R=!0,S(ce),b?.(t,{nodeId:s,handleId:a,handleType:U})}B===0&&ue();function de(Se){if(!R){const{x:Ce,y:je}=bn(Se),Le=Ce-$,tt=je-ee;if(!(Le*Le+tt*tt>B*B))return;ue()}if(!O()||!ne){ge(Se);return}const be=N();F=bn(Se,X),V=hD(El(F,be,!1,[1,1]),o,p,ne),P||(W(),P=!0);const Ee=I_(Se,{handle:V,connectionMode:r,fromNodeId:s,fromHandleId:a,fromType:f?"target":"source",isValidConnection:w,doc:I,lib:m,flowId:g,nodeLookup:p});k=Ee.handleDomNode,te=Ee.connection,M=mD(!!V,Ee.isValid);const oe=p.get(s),fe=oe?Ho(oe,ne,xe.Left,!0):ce.from,me={...ce,from:fe,isValid:M,to:Ee.toHandle&&M?ku({x:Ee.toHandle.x,y:Ee.toHandle.y},be):F,toHandle:Ee.toHandle,toPosition:M&&Ee.toHandle?Ee.toHandle.position:w1[ne.position],toNode:Ee.toHandle?p.get(Ee.toHandle.nodeId):null,pointer:F};S(me),ce=me}function ge(Se){if(!("touches"in Se&&Se.touches.length>0)){if(R){(V||k)&&te&&M&&E?.(te);const{inProgress:be,...Ee}=ce,oe={...Ee,toPosition:ce.toHandle?ce.toPosition:null};C?.(Se,oe),u&&D?.(Se,oe)}_(),cancelAnimationFrame(ae),P=!1,M=!1,te=null,k=null,I.removeEventListener("mousemove",de),I.removeEventListener("mouseup",ge),I.removeEventListener("touchmove",de),I.removeEventListener("touchend",ge)}}I.addEventListener("mousemove",de),I.addEventListener("mouseup",ge),I.addEventListener("touchmove",de),I.addEventListener("touchend",ge)}function I_(t,{handle:r,connectionMode:o,fromNodeId:a,fromHandleId:s,fromType:u,doc:f,lib:h,flowId:p,isValidConnection:m=Y_,nodeLookup:y}){const g=u==="target",x=r?f.querySelector(`.${h}-flow__handle[data-id="${p}-${r?.nodeId}-${r?.id}-${r?.type}"]`):null,{x:_,y:b}=bn(t),E=f.elementFromPoint(_,b),C=E?.classList.contains(`${h}-flow__handle`)?E:x,w={handleDomNode:C,isValid:!1,connection:null,toHandle:null};if(C){const D=X_(void 0,C),S=C.getAttribute("data-nodeid"),N=C.getAttribute("data-handleid"),O=C.classList.contains("connectable"),z=C.classList.contains("connectableend");if(!S||!D)return w;const B={source:g?S:a,sourceHandle:g?N:s,target:g?a:S,targetHandle:g?s:N};w.connection=B;const I=O&&z&&(o===ji.Strict?g&&D==="source"||!g&&D==="target":S!==a||N!==s);w.isValid=I&&m(B),w.toHandle=q_(S,D,N,y,o,!0)}return w}const Uh={onPointerDown:pD,isValid:I_};function gD({domNode:t,panZoom:r,getTransform:o,getViewScale:a}){const s=Kt(t);function u({translateExtent:h,width:p,height:m,zoomStep:y=1,pannable:g=!0,zoomable:x=!0,inversePan:_=!1}){const b=S=>{if(S.sourceEvent.type!=="wheel"||!r)return;const N=o(),O=S.sourceEvent.ctrlKey&&cl()?10:1,z=-S.sourceEvent.deltaY*(S.sourceEvent.deltaMode===1?.05:S.sourceEvent.deltaMode?1:.002)*y,B=N[2]*Math.pow(2,z*O);r.scaleTo(B)};let E=[0,0];const C=S=>{(S.sourceEvent.type==="mousedown"||S.sourceEvent.type==="touchstart")&&(E=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY])},w=S=>{const N=o();if(S.sourceEvent.type!=="mousemove"&&S.sourceEvent.type!=="touchmove"||!r)return;const O=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY],z=[O[0]-E[0],O[1]-E[1]];E=O;const B=a()*Math.max(N[2],Math.log(N[2]))*(_?-1:1),q={x:N[0]-z[0]*B,y:N[1]-z[1]*B},I=[[0,0],[p,m]];r.setViewportConstrained({x:q.x,y:q.y,zoom:N[2]},I,h)},D=b_().on("start",C).on("zoom",g?w:null).on("zoom.wheel",x?b:null);s.call(D,{})}function f(){s.on("zoom",null)}return{update:u,destroy:f,pointer:yn}}const fc=t=>({x:t.x,y:t.y,zoom:t.k}),Kd=({x:t,y:r,zoom:o})=>lc.translate(t,r).scale(o),Mi=(t,r)=>t.target.closest(`.${r}`),P_=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),yD=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Jd=(t,r=0,o=yD,a=()=>{})=>{const s=typeof r=="number"&&r>0;return s||a(),s?t.transition().duration(r).ease(o).on("end",a):t},$_=t=>{const r=t.ctrlKey&&cl()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function xD({zoomPanValues:t,noWheelClassName:r,d3Selection:o,d3Zoom:a,panOnScrollMode:s,panOnScrollSpeed:u,zoomOnPinch:f,onPanZoomStart:h,onPanZoom:p,onPanZoomEnd:m}){return y=>{if(Mi(y,r))return y.ctrlKey&&y.preventDefault(),!1;y.preventDefault(),y.stopImmediatePropagation();const g=o.property("__zoom").k||1;if(y.ctrlKey&&f){const C=yn(y),w=$_(y),D=g*Math.pow(2,w);a.scaleTo(o,D,C,y);return}const x=y.deltaMode===1?20:1;let _=s===Mo.Vertical?0:y.deltaX*x,b=s===Mo.Horizontal?0:y.deltaY*x;!cl()&&y.shiftKey&&s!==Mo.Vertical&&(_=y.deltaY*x,b=0),a.translateBy(o,-(_/g)*u,-(b/g)*u,{internal:!0});const E=fc(o.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(p?.(y,E),t.panScrollTimeout=setTimeout(()=>{m?.(y,E),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,h?.(y,E))}}function vD({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:o}){return function(a,s){const u=a.type==="wheel",f=!r&&u&&!a.ctrlKey,h=Mi(a,t);if(a.ctrlKey&&u&&h&&a.preventDefault(),f||h)return null;a.preventDefault(),o.call(this,a,s)}}function bD({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:o}){return a=>{if(a.sourceEvent?.internal)return;const s=fc(a.transform);t.mouseButton=a.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=s,a.sourceEvent?.type==="mousedown"&&r(!0),o&&o?.(a.sourceEvent,s)}}function _D({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:o,onTransformChange:a,onPanZoom:s}){return u=>{t.usedRightMouseButton=!!(o&&P_(r,t.mouseButton??0)),u.sourceEvent?.sync||a([u.transform.x,u.transform.y,u.transform.k]),s&&!u.sourceEvent?.internal&&s?.(u.sourceEvent,fc(u.transform))}}function ED({zoomPanValues:t,panOnDrag:r,panOnScroll:o,onDraggingChange:a,onPanZoomEnd:s,onPaneContextMenu:u}){return f=>{if(!f.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,u&&P_(r,t.mouseButton??0)&&!t.usedRightMouseButton&&f.sourceEvent&&u(f.sourceEvent),t.usedRightMouseButton=!1,a(!1),s)){const h=fc(f.transform);t.prevViewport=h,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{s?.(f.sourceEvent,h)},o?150:0)}}}function SD({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:o,panOnDrag:a,panOnScroll:s,zoomOnDoubleClick:u,userSelectionActive:f,noWheelClassName:h,noPanClassName:p,lib:m,connectionInProgress:y}){return g=>{const x=t||r,_=o&&g.ctrlKey,b=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Mi(g,`${m}-flow__node`)||Mi(g,`${m}-flow__edge`)))return!0;if(!a&&!x&&!s&&!u&&!o||f||y&&!b||Mi(g,h)&&b||Mi(g,p)&&(!b||s&&b&&!t)||!o&&g.ctrlKey&&b)return!1;if(!o&&g.type==="touchstart"&&g.touches?.length>1)return g.preventDefault(),!1;if(!x&&!s&&!_&&b||!a&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(a)&&!a.includes(g.button)&&g.type==="mousedown")return!1;const E=Array.isArray(a)&&a.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||b)&&E}}function wD({domNode:t,minZoom:r,maxZoom:o,translateExtent:a,viewport:s,onPanZoom:u,onPanZoomStart:f,onPanZoomEnd:h,onDraggingChange:p}){const m={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},y=t.getBoundingClientRect(),g=b_().scaleExtent([r,o]).translateExtent(a),x=Kt(t).call(g);D({x:s.x,y:s.y,zoom:Fi(s.zoom,r,o)},[[0,0],[y.width,y.height]],a);const _=x.on("wheel.zoom"),b=x.on("dblclick.zoom");g.wheelDelta($_);function E(V,$){return x?new Promise(ee=>{g?.interpolate($?.interpolate==="linear"?Ka:bu).transform(Jd(x,$?.duration,$?.ease,()=>ee(!0)),V)}):Promise.resolve(!1)}function C({noWheelClassName:V,noPanClassName:$,onPaneContextMenu:ee,userSelectionActive:U,panOnScroll:X,panOnDrag:R,panOnScrollMode:H,panOnScrollSpeed:F,preventScrolling:P,zoomOnPinch:te,zoomOnScroll:M,zoomOnDoubleClick:k,zoomActivationKeyPressed:W,lib:ne,onTransformChange:se,connectionInProgress:he,paneClickDistance:ce,selectionOnDrag:ue}){U&&!m.isZoomingOrPanning&&w();const de=X&&!W&&!U;g.clickDistance(ue?1/0:!vn(ce)||ce<0?0:ce);const ge=de?xD({zoomPanValues:m,noWheelClassName:V,d3Selection:x,d3Zoom:g,panOnScrollMode:H,panOnScrollSpeed:F,zoomOnPinch:te,onPanZoomStart:f,onPanZoom:u,onPanZoomEnd:h}):vD({noWheelClassName:V,preventScrolling:P,d3ZoomHandler:_});if(x.on("wheel.zoom",ge,{passive:!1}),!U){const be=bD({zoomPanValues:m,onDraggingChange:p,onPanZoomStart:f});g.on("start",be);const Ee=_D({zoomPanValues:m,panOnDrag:R,onPaneContextMenu:!!ee,onPanZoom:u,onTransformChange:se});g.on("zoom",Ee);const oe=ED({zoomPanValues:m,panOnDrag:R,panOnScroll:X,onPaneContextMenu:ee,onPanZoomEnd:h,onDraggingChange:p});g.on("end",oe)}const Se=SD({zoomActivationKeyPressed:W,panOnDrag:R,zoomOnScroll:M,panOnScroll:X,zoomOnDoubleClick:k,zoomOnPinch:te,userSelectionActive:U,noPanClassName:$,noWheelClassName:V,lib:ne,connectionInProgress:he});g.filter(Se),k?x.on("dblclick.zoom",b):x.on("dblclick.zoom",null)}function w(){g.on("zoom",null)}async function D(V,$,ee){const U=Kd(V),X=g?.constrain()(U,$,ee);return X&&await E(X),new Promise(R=>R(X))}async function S(V,$){const ee=Kd(V);return await E(ee,$),new Promise(U=>U(ee))}function N(V){if(x){const $=Kd(V),ee=x.property("__zoom");(ee.k!==V.zoom||ee.x!==V.x||ee.y!==V.y)&&g?.transform(x,$,null,{sync:!0})}}function O(){const V=x?v_(x.node()):{x:0,y:0,k:1};return{x:V.x,y:V.y,zoom:V.k}}function z(V,$){return x?new Promise(ee=>{g?.interpolate($?.interpolate==="linear"?Ka:bu).scaleTo(Jd(x,$?.duration,$?.ease,()=>ee(!0)),V)}):Promise.resolve(!1)}function B(V,$){return x?new Promise(ee=>{g?.interpolate($?.interpolate==="linear"?Ka:bu).scaleBy(Jd(x,$?.duration,$?.ease,()=>ee(!0)),V)}):Promise.resolve(!1)}function q(V){g?.scaleExtent(V)}function I(V){g?.translateExtent(V)}function ae(V){const $=!vn(V)||V<0?0:V;g?.clickDistance($)}return{update:C,destroy:w,setViewport:S,setViewportConstrained:D,getViewport:O,scaleTo:z,scaleBy:B,setScaleExtent:q,setTranslateExtent:I,syncViewport:N,setClickDistance:ae}}var Gi;(function(t){t.Line="line",t.Handle="handle"})(Gi||(Gi={}));function AD({width:t,prevWidth:r,height:o,prevHeight:a,affectsX:s,affectsY:u}){const f=t-r,h=o-a,p=[f>0?1:f<0?-1:0,h>0?1:h<0?-1:0];return f&&s&&(p[0]=p[0]*-1),h&&u&&(p[1]=p[1]*-1),p}function L1(t){const r=t.includes("right")||t.includes("left"),o=t.includes("bottom")||t.includes("top"),a=t.includes("left"),s=t.includes("top");return{isHorizontal:r,isVertical:o,affectsX:a,affectsY:s}}function qr(t,r){return Math.max(0,r-t)}function Xr(t,r){return Math.max(0,t-r)}function su(t,r,o){return Math.max(0,r-t,t-o)}function j1(t,r){return t?!r:r}function TD(t,r,o,a,s,u,f,h){let{affectsX:p,affectsY:m}=r;const{isHorizontal:y,isVertical:g}=r,x=y&&g,{xSnapped:_,ySnapped:b}=o,{minWidth:E,maxWidth:C,minHeight:w,maxHeight:D}=a,{x:S,y:N,width:O,height:z,aspectRatio:B}=t;let q=Math.floor(y?_-t.pointerX:0),I=Math.floor(g?b-t.pointerY:0);const ae=O+(p?-q:q),V=z+(m?-I:I),$=-u[0]*O,ee=-u[1]*z;let U=su(ae,E,C),X=su(V,w,D);if(f){let F=0,P=0;p&&q<0?F=qr(S+q+$,f[0][0]):!p&&q>0&&(F=Xr(S+ae+$,f[1][0])),m&&I<0?P=qr(N+I+ee,f[0][1]):!m&&I>0&&(P=Xr(N+V+ee,f[1][1])),U=Math.max(U,F),X=Math.max(X,P)}if(h){let F=0,P=0;p&&q>0?F=Xr(S+q,h[0][0]):!p&&q<0&&(F=qr(S+ae,h[1][0])),m&&I>0?P=Xr(N+I,h[0][1]):!m&&I<0&&(P=qr(N+V,h[1][1])),U=Math.max(U,F),X=Math.max(X,P)}if(s){if(y){const F=su(ae/B,w,D)*B;if(U=Math.max(U,F),f){let P=0;!p&&!m||p&&!m&&x?P=Xr(N+ee+ae/B,f[1][1])*B:P=qr(N+ee+(p?q:-q)/B,f[0][1])*B,U=Math.max(U,P)}if(h){let P=0;!p&&!m||p&&!m&&x?P=qr(N+ae/B,h[1][1])*B:P=Xr(N+(p?q:-q)/B,h[0][1])*B,U=Math.max(U,P)}}if(g){const F=su(V*B,E,C)/B;if(X=Math.max(X,F),f){let P=0;!p&&!m||m&&!p&&x?P=Xr(S+V*B+$,f[1][0])/B:P=qr(S+(m?I:-I)*B+$,f[0][0])/B,X=Math.max(X,P)}if(h){let P=0;!p&&!m||m&&!p&&x?P=qr(S+V*B,h[1][0])/B:P=Xr(S+(m?I:-I)*B,h[0][0])/B,X=Math.max(X,P)}}}I=I+(I<0?X:-X),q=q+(q<0?U:-U),s&&(x?ae>V*B?I=(j1(p,m)?-q:q)/B:q=(j1(p,m)?-I:I)*B:y?(I=q/B,m=p):(q=I*B,p=m));const R=p?S+q:S,H=m?N+I:N;return{width:O+(p?-q:q),height:z+(m?-I:I),x:u[0]*q*(p?-1:1)+R,y:u[1]*I*(m?-1:1)+H}}const Z_={width:0,height:0,x:0,y:0},CD={...Z_,pointerX:0,pointerY:0,aspectRatio:1};function ND(t){return[[0,0],[t.measured.width,t.measured.height]]}function RD(t,r,o){const a=r.position.x+t.position.x,s=r.position.y+t.position.y,u=t.measured.width??0,f=t.measured.height??0,h=o[0]*u,p=o[1]*f;return[[a-h,s-p],[a+u-h,s+f-p]]}function MD({domNode:t,nodeId:r,getStoreItems:o,onChange:a,onEnd:s}){const u=Kt(t);let f={controlDirection:L1("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function h({controlPosition:m,boundaries:y,keepAspectRatio:g,resizeDirection:x,onResizeStart:_,onResize:b,onResizeEnd:E,shouldResize:C}){let w={...Z_},D={...CD};f={boundaries:y,resizeDirection:x,keepAspectRatio:g,controlDirection:L1(m)};let S,N=null,O=[],z,B,q,I=!1;const ae=i_().on("start",V=>{const{nodeLookup:$,transform:ee,snapGrid:U,snapToGrid:X,nodeOrigin:R,paneDomNode:H}=o();if(S=$.get(r),!S)return;N=H?.getBoundingClientRect()??null;const{xSnapped:F,ySnapped:P}=Ja(V.sourceEvent,{transform:ee,snapGrid:U,snapToGrid:X,containerBounds:N});w={width:S.measured.width??0,height:S.measured.height??0,x:S.position.x??0,y:S.position.y??0},D={...w,pointerX:F,pointerY:P,aspectRatio:w.width/w.height},z=void 0,S.parentId&&(S.extent==="parent"||S.expandParent)&&(z=$.get(S.parentId),B=z&&S.extent==="parent"?ND(z):void 0),O=[],q=void 0;for(const[te,M]of $)if(M.parentId===r&&(O.push({id:te,position:{...M.position},extent:M.extent}),M.extent==="parent"||M.expandParent)){const k=RD(M,S,M.origin??R);q?q=[[Math.min(k[0][0],q[0][0]),Math.min(k[0][1],q[0][1])],[Math.max(k[1][0],q[1][0]),Math.max(k[1][1],q[1][1])]]:q=k}_?.(V,{...w})}).on("drag",V=>{const{transform:$,snapGrid:ee,snapToGrid:U,nodeOrigin:X}=o(),R=Ja(V.sourceEvent,{transform:$,snapGrid:ee,snapToGrid:U,containerBounds:N}),H=[];if(!S)return;const{x:F,y:P,width:te,height:M}=w,k={},W=S.origin??X,{width:ne,height:se,x:he,y:ce}=TD(D,f.controlDirection,R,f.boundaries,f.keepAspectRatio,W,B,q),ue=ne!==te,de=se!==M,ge=he!==F&&ue,Se=ce!==P&&de;if(!ge&&!Se&&!ue&&!de)return;if((ge||Se||W[0]===1||W[1]===1)&&(k.x=ge?he:w.x,k.y=Se?ce:w.y,w.x=k.x,w.y=k.y,O.length>0)){const fe=he-F,me=ce-P;for(const Ce of O)Ce.position={x:Ce.position.x-fe+W[0]*(ne-te),y:Ce.position.y-me+W[1]*(se-M)},H.push(Ce)}if((ue||de)&&(k.width=ue&&(!f.resizeDirection||f.resizeDirection==="horizontal")?ne:w.width,k.height=de&&(!f.resizeDirection||f.resizeDirection==="vertical")?se:w.height,w.width=k.width,w.height=k.height),z&&S.expandParent){const fe=W[0]*(k.width??0);k.x&&k.x<fe&&(w.x=fe,D.x=D.x-(k.x-fe));const me=W[1]*(k.height??0);k.y&&k.y<me&&(w.y=me,D.y=D.y-(k.y-me))}const be=AD({width:w.width,prevWidth:te,height:w.height,prevHeight:M,affectsX:f.controlDirection.affectsX,affectsY:f.controlDirection.affectsY}),Ee={...w,direction:be};C?.(V,Ee)!==!1&&(I=!0,b?.(V,Ee),a(k,H))}).on("end",V=>{I&&(E?.(V,{...w}),s?.({...w}),I=!1)});u.call(ae)}function p(){u.on(".drag",null)}return{update:h,destroy:p}}var Wd={exports:{}},eh={},th={exports:{}},nh={};var F1;function DD(){if(F1)return nh;F1=1;var t=hl();function r(g,x){return g===x&&(g!==0||1/g===1/x)||g!==g&&x!==x}var o=typeof Object.is=="function"?Object.is:r,a=t.useState,s=t.useEffect,u=t.useLayoutEffect,f=t.useDebugValue;function h(g,x){var _=x(),b=a({inst:{value:_,getSnapshot:x}}),E=b[0].inst,C=b[1];return u(function(){E.value=_,E.getSnapshot=x,p(E)&&C({inst:E})},[g,_,x]),s(function(){return p(E)&&C({inst:E}),g(function(){p(E)&&C({inst:E})})},[g]),f(_),_}function p(g){var x=g.getSnapshot;g=g.value;try{var _=x();return!o(g,_)}catch{return!0}}function m(g,x){return x()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:h;return nh.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:y,nh}var k1;function OD(){return k1||(k1=1,th.exports=DD()),th.exports}var V1;function zD(){if(V1)return eh;V1=1;var t=hl(),r=OD();function o(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var a=typeof Object.is=="function"?Object.is:o,s=r.useSyncExternalStore,u=t.useRef,f=t.useEffect,h=t.useMemo,p=t.useDebugValue;return eh.useSyncExternalStoreWithSelector=function(m,y,g,x,_){var b=u(null);if(b.current===null){var E={hasValue:!1,value:null};b.current=E}else E=b.current;b=h(function(){function w(z){if(!D){if(D=!0,S=z,z=x(z),_!==void 0&&E.hasValue){var B=E.value;if(_(B,z))return N=B}return N=z}if(B=N,a(S,z))return B;var q=x(z);return _!==void 0&&_(B,q)?(S=z,B):(S=z,N=q)}var D=!1,S,N,O=g===void 0?null:g;return[function(){return w(y())},O===null?void 0:function(){return w(O())}]},[y,g,x,_]);var C=s(m,b[0],b[1]);return f(function(){E.hasValue=!0,E.value=C},[C]),p(C),C},eh}var G1;function BD(){return G1||(G1=1,Wd.exports=zD()),Wd.exports}var UD=BD();const HD=yv(UD),LD={},q1=t=>{let r;const o=new Set,a=(y,g)=>{const x=typeof y=="function"?y(r):y;if(!Object.is(x,r)){const _=r;r=g??(typeof x!="object"||x===null)?x:Object.assign({},r,x),o.forEach(b=>b(r,_))}},s=()=>r,p={setState:a,getState:s,getInitialState:()=>m,subscribe:y=>(o.add(y),()=>o.delete(y)),destroy:()=>{(LD?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),o.clear()}},m=r=t(a,s,p);return p},jD=t=>t?q1(t):q1,{useDebugValue:FD}=qS,{useSyncExternalStoreWithSelector:kD}=HD,VD=t=>t;function Q_(t,r=VD,o){const a=kD(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,o);return FD(a),a}const X1=(t,r)=>{const o=jD(t),a=(s,u=r)=>Q_(o,s,u);return Object.assign(a,o),a},GD=(t,r)=>t?X1(t,r):X1;function We(t,r){if(Object.is(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(const[a,s]of t)if(!Object.is(s,r.get(a)))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(const a of t)if(!r.has(a))return!1;return!0}const o=Object.keys(t);if(o.length!==Object.keys(r).length)return!1;for(const a of o)if(!Object.prototype.hasOwnProperty.call(r,a)||!Object.is(t[a],r[a]))return!1;return!0}var qD=xv();const dc=j.createContext(null),XD=dc.Provider,K_=Un.error001();function He(t,r){const o=j.useContext(dc);if(o===null)throw new Error(K_);return Q_(o,t,r)}function et(){const t=j.useContext(dc);if(t===null)throw new Error(K_);return j.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Y1={display:"none"},YD={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},J_="react-flow__node-desc",W_="react-flow__edge-desc",ID="react-flow__aria-live",PD=t=>t.ariaLiveMessage,$D=t=>t.ariaLabelConfig;function ZD({rfId:t}){const r=He(PD);return A.jsx("div",{id:`${ID}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:YD,children:r})}function QD({rfId:t,disableKeyboardA11y:r}){const o=He($D);return A.jsxs(A.Fragment,{children:[A.jsx("div",{id:`${J_}-${t}`,style:Y1,children:r?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),A.jsx("div",{id:`${W_}-${t}`,style:Y1,children:o["edge.a11yDescription.default"]}),!r&&A.jsx(ZD,{rfId:t})]})}const Do=j.forwardRef(({position:t="top-left",children:r,className:o,style:a,...s},u)=>{const f=`${t}`.split("-");return A.jsx("div",{className:gt(["react-flow__panel",o,...f]),style:a,ref:u,...s,children:r})});Do.displayName="Panel";function KD({proOptions:t,position:r="bottom-right"}){return t?.hideAttribution?null:A.jsx(Do,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:A.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const JD=t=>{const r=[],o=[];for(const[,a]of t.nodeLookup)a.selected&&r.push(a.internals.userNode);for(const[,a]of t.edgeLookup)a.selected&&o.push(a);return{selectedNodes:r,selectedEdges:o}},uu=t=>t.id;function WD(t,r){return We(t.selectedNodes.map(uu),r.selectedNodes.map(uu))&&We(t.selectedEdges.map(uu),r.selectedEdges.map(uu))}function e5({onSelectionChange:t}){const r=et(),{selectedNodes:o,selectedEdges:a}=He(JD,WD);return j.useEffect(()=>{const s={nodes:o,edges:a};t?.(s),r.getState().onSelectionChangeHandlers.forEach(u=>u(s))},[o,a,t]),null}const t5=t=>!!t.onSelectionChangeHandlers;function n5({onSelectionChange:t}){const r=He(t5);return t||r?A.jsx(e5,{onSelectionChange:t}):null}const eE=[0,0],r5={x:0,y:0,zoom:1},o5=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],I1=[...o5,"rfId"],i5=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),P1={translateExtent:ll,nodeOrigin:eE,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function a5(t){const{setNodes:r,setEdges:o,setMinZoom:a,setMaxZoom:s,setTranslateExtent:u,setNodeExtent:f,reset:h,setDefaultNodesAndEdges:p}=He(i5,We),m=et();j.useEffect(()=>(p(t.defaultNodes,t.defaultEdges),()=>{y.current=P1,h()}),[]);const y=j.useRef(P1);return j.useEffect(()=>{for(const g of I1){const x=t[g],_=y.current[g];x!==_&&(typeof t[g]>"u"||(g==="nodes"?r(x):g==="edges"?o(x):g==="minZoom"?a(x):g==="maxZoom"?s(x):g==="translateExtent"?u(x):g==="nodeExtent"?f(x):g==="ariaLabelConfig"?m.setState({ariaLabelConfig:q8(x)}):g==="fitView"?m.setState({fitViewQueued:x}):g==="fitViewOptions"?m.setState({fitViewOptions:x}):m.setState({[g]:x})))}y.current=t},I1.map(g=>t[g])),null}function $1(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function l5(t){const[r,o]=j.useState(t==="system"?null:t);return j.useEffect(()=>{if(t!=="system"){o(t);return}const a=$1(),s=()=>o(a?.matches?"dark":"light");return s(),a?.addEventListener("change",s),()=>{a?.removeEventListener("change",s)}},[t]),r!==null?r:$1()?.matches?"dark":"light"}const Z1=typeof document<"u"?document:null;function fl(t=null,r={target:Z1,actInsideInputWithModifier:!0}){const[o,a]=j.useState(!1),s=j.useRef(!1),u=j.useRef(new Set([])),[f,h]=j.useMemo(()=>{if(t!==null){const m=(Array.isArray(t)?t:[t]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
|
|
890
|
+
`).replace(`
|
|
891
|
+
|
|
892
|
+
`,`
|
|
893
|
+
+`).split(`
|
|
894
|
+
`)),y=m.reduce((g,x)=>g.concat(...x),[]);return[m,y]}return[[],[]]},[t]);return j.useEffect(()=>{const p=r?.target??Z1,m=r?.actInsideInputWithModifier??!0;if(t!==null){const y=_=>{if(s.current=_.ctrlKey||_.metaKey||_.shiftKey||_.altKey,(!s.current||s.current&&!m)&&B_(_))return!1;const E=K1(_.code,h);if(u.current.add(_[E]),Q1(f,u.current,!1)){const C=_.composedPath?.()?.[0]||_.target,w=C?.nodeName==="BUTTON"||C?.nodeName==="A";r.preventDefault!==!1&&(s.current||!w)&&_.preventDefault(),a(!0)}},g=_=>{const b=K1(_.code,h);Q1(f,u.current,!0)?(a(!1),u.current.clear()):u.current.delete(_[b]),_.key==="Meta"&&u.current.clear(),s.current=!1},x=()=>{u.current.clear(),a(!1)};return p?.addEventListener("keydown",y),p?.addEventListener("keyup",g),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{p?.removeEventListener("keydown",y),p?.removeEventListener("keyup",g),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[t,a]),o}function Q1(t,r,o){return t.filter(a=>o||a.length===r.size).some(a=>a.every(s=>r.has(s)))}function K1(t,r){return r.includes(t)?"code":"key"}const s5=()=>{const t=et();return j.useMemo(()=>({zoomIn:r=>{const{panZoom:o}=t.getState();return o?o.scaleBy(1.2,{duration:r?.duration}):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:o}=t.getState();return o?o.scaleBy(1/1.2,{duration:r?.duration}):Promise.resolve(!1)},zoomTo:(r,o)=>{const{panZoom:a}=t.getState();return a?a.scaleTo(r,{duration:o?.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,o)=>{const{transform:[a,s,u],panZoom:f}=t.getState();return f?(await f.setViewport({x:r.x??a,y:r.y??s,zoom:r.zoom??u},o),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,o,a]=t.getState().transform;return{x:r,y:o,zoom:a}},setCenter:async(r,o,a)=>t.getState().setCenter(r,o,a),fitBounds:async(r,o)=>{const{width:a,height:s,minZoom:u,maxZoom:f,panZoom:h}=t.getState(),p=O0(r,a,s,u,f,o?.padding??.1);return h?(await h.setViewport(p,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,o={})=>{const{transform:a,snapGrid:s,snapToGrid:u,domNode:f}=t.getState();if(!f)return r;const{x:h,y:p}=f.getBoundingClientRect(),m={x:r.x-h,y:r.y-p},y=o.snapGrid??s,g=o.snapToGrid??u;return El(m,a,g,y)},flowToScreenPosition:r=>{const{transform:o,domNode:a}=t.getState();if(!a)return r;const{x:s,y:u}=a.getBoundingClientRect(),f=ku(r,o);return{x:f.x+s,y:f.y+u}}}),[])};function tE(t,r){const o=[],a=new Map,s=[];for(const u of t)if(u.type==="add"){s.push(u);continue}else if(u.type==="remove"||u.type==="replace")a.set(u.id,[u]);else{const f=a.get(u.id);f?f.push(u):a.set(u.id,[u])}for(const u of r){const f=a.get(u.id);if(!f){o.push(u);continue}if(f[0].type==="remove")continue;if(f[0].type==="replace"){o.push({...f[0].item});continue}const h={...u};for(const p of f)u5(p,h);o.push(h)}return s.length&&s.forEach(u=>{u.index!==void 0?o.splice(u.index,0,{...u.item}):o.push({...u.item})}),o}function u5(t,r){switch(t.type){case"select":{r.selected=t.selected;break}case"position":{typeof t.position<"u"&&(r.position=t.position),typeof t.dragging<"u"&&(r.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(r.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(r.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(r.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(r.resizing=t.resizing);break}}}function nE(t,r){return tE(t,r)}function rE(t,r){return tE(t,r)}function To(t,r){return{id:t,type:"select",selected:r}}function Di(t,r=new Set,o=!1){const a=[];for(const[s,u]of t){const f=r.has(s);!(u.selected===void 0&&!f)&&u.selected!==f&&(o&&(u.selected=f),a.push(To(u.id,f)))}return a}function J1({items:t=[],lookup:r}){const o=[],a=new Map(t.map(s=>[s.id,s]));for(const[s,u]of t.entries()){const f=r.get(u.id),h=f?.internals?.userNode??f;h!==void 0&&h!==u&&o.push({id:u.id,item:u,type:"replace"}),h===void 0&&o.push({item:u,type:"add",index:s})}for(const[s]of r)a.get(s)===void 0&&o.push({id:s,type:"remove"});return o}function W1(t){return{id:t.id,type:"remove"}}const ev=t=>z8(t),c5=t=>A_(t);function oE(t){return j.forwardRef(t)}const f5=typeof window<"u"?j.useLayoutEffect:j.useEffect;function tv(t){const[r,o]=j.useState(BigInt(0)),[a]=j.useState(()=>d5(()=>o(s=>s+BigInt(1))));return f5(()=>{const s=a.get();s.length&&(t(s),a.reset())},[r]),a}function d5(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:o=>{r.push(o),t()}}}const iE=j.createContext(null);function h5({children:t}){const r=et(),o=j.useCallback(h=>{const{nodes:p=[],setNodes:m,hasDefaultNodes:y,onNodesChange:g,nodeLookup:x,fitViewQueued:_,onNodesChangeMiddlewareMap:b}=r.getState();let E=p;for(const w of h)E=typeof w=="function"?w(E):w;let C=J1({items:E,lookup:x});for(const w of b.values())C=w(C);y&&m(E),C.length>0?g?.(C):_&&window.requestAnimationFrame(()=>{const{fitViewQueued:w,nodes:D,setNodes:S}=r.getState();w&&S(D)})},[]),a=tv(o),s=j.useCallback(h=>{const{edges:p=[],setEdges:m,hasDefaultEdges:y,onEdgesChange:g,edgeLookup:x}=r.getState();let _=p;for(const b of h)_=typeof b=="function"?b(_):b;y?m(_):g&&g(J1({items:_,lookup:x}))},[]),u=tv(s),f=j.useMemo(()=>({nodeQueue:a,edgeQueue:u}),[]);return A.jsx(iE.Provider,{value:f,children:t})}function m5(){const t=j.useContext(iE);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const p5=t=>!!t.panZoom;function hc(){const t=s5(),r=et(),o=m5(),a=He(p5),s=j.useMemo(()=>{const u=g=>r.getState().nodeLookup.get(g),f=g=>{o.nodeQueue.push(g)},h=g=>{o.edgeQueue.push(g)},p=g=>{const{nodeLookup:x,nodeOrigin:_}=r.getState(),b=ev(g)?g:x.get(g.id),E=b.parentId?O_(b.position,b.measured,b.parentId,x,_):b.position,C={...b,position:E,width:b.measured?.width??b.width,height:b.measured?.height??b.height};return ki(C)},m=(g,x,_={replace:!1})=>{f(b=>b.map(E=>{if(E.id===g){const C=typeof x=="function"?x(E):x;return _.replace&&ev(C)?C:{...E,...C}}return E}))},y=(g,x,_={replace:!1})=>{h(b=>b.map(E=>{if(E.id===g){const C=typeof x=="function"?x(E):x;return _.replace&&c5(C)?C:{...E,...C}}return E}))};return{getNodes:()=>r.getState().nodes.map(g=>({...g})),getNode:g=>u(g)?.internals.userNode,getInternalNode:u,getEdges:()=>{const{edges:g=[]}=r.getState();return g.map(x=>({...x}))},getEdge:g=>r.getState().edgeLookup.get(g),setNodes:f,setEdges:h,addNodes:g=>{const x=Array.isArray(g)?g:[g];o.nodeQueue.push(_=>[..._,...x])},addEdges:g=>{const x=Array.isArray(g)?g:[g];o.edgeQueue.push(_=>[..._,...x])},toObject:()=>{const{nodes:g=[],edges:x=[],transform:_}=r.getState(),[b,E,C]=_;return{nodes:g.map(w=>({...w})),edges:x.map(w=>({...w})),viewport:{x:b,y:E,zoom:C}}},deleteElements:async({nodes:g=[],edges:x=[]})=>{const{nodes:_,edges:b,onNodesDelete:E,onEdgesDelete:C,triggerNodeChanges:w,triggerEdgeChanges:D,onDelete:S,onBeforeDelete:N}=r.getState(),{nodes:O,edges:z}=await j8({nodesToRemove:g,edgesToRemove:x,nodes:_,edges:b,onBeforeDelete:N}),B=z.length>0,q=O.length>0;if(B){const I=z.map(W1);C?.(z),D(I)}if(q){const I=O.map(W1);E?.(O),w(I)}return(q||B)&&S?.({nodes:O,edges:z}),{deletedNodes:O,deletedEdges:z}},getIntersectingNodes:(g,x=!0,_)=>{const b=T1(g),E=b?g:p(g),C=_!==void 0;return E?(_||r.getState().nodes).filter(w=>{const D=r.getState().nodeLookup.get(w.id);if(D&&!b&&(w.id===g.id||!D.internals.positionAbsolute))return!1;const S=ki(C?w:D),N=ul(S,E);return x&&N>0||N>=S.width*S.height||N>=E.width*E.height}):[]},isNodeIntersecting:(g,x,_=!0)=>{const E=T1(g)?g:p(g);if(!E)return!1;const C=ul(E,x);return _&&C>0||C>=x.width*x.height||C>=E.width*E.height},updateNode:m,updateNodeData:(g,x,_={replace:!1})=>{m(g,b=>{const E=typeof x=="function"?x(b):x;return _.replace?{...b,data:E}:{...b,data:{...b.data,...E}}},_)},updateEdge:y,updateEdgeData:(g,x,_={replace:!1})=>{y(g,b=>{const E=typeof x=="function"?x(b):x;return _.replace?{...b,data:E}:{...b,data:{...b.data,...E}}},_)},getNodesBounds:g=>{const{nodeLookup:x,nodeOrigin:_}=r.getState();return B8(g,{nodeLookup:x,nodeOrigin:_})},getHandleConnections:({type:g,id:x,nodeId:_})=>Array.from(r.getState().connectionLookup.get(`${_}-${g}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:g,handleId:x,nodeId:_})=>Array.from(r.getState().connectionLookup.get(`${_}${g?x?`-${g}-${x}`:`-${g}`:""}`)?.values()??[]),fitView:async g=>{const x=r.getState().fitViewResolver??G8();return r.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:x}),o.nodeQueue.push(_=>[..._]),x.promise}}},[]);return j.useMemo(()=>({...s,...t,viewportInitialized:a}),[a])}const nv=t=>t.selected,g5=typeof window<"u"?window:void 0;function y5({deleteKeyCode:t,multiSelectionKeyCode:r}){const o=et(),{deleteElements:a}=hc(),s=fl(t,{actInsideInputWithModifier:!1}),u=fl(r,{target:g5});j.useEffect(()=>{if(s){const{edges:f,nodes:h}=o.getState();a({nodes:h.filter(nv),edges:f.filter(nv)}),o.setState({nodesSelectionActive:!1})}},[s]),j.useEffect(()=>{o.setState({multiSelectionActive:u})},[u])}function x5(t){const r=et();j.useEffect(()=>{const o=()=>{if(!t.current||!(t.current.checkVisibility?.()??!0))return!1;const a=z0(t.current);(a.height===0||a.width===0)&&r.getState().onError?.("004",Un.error004()),r.setState({width:a.width||500,height:a.height||500})};if(t.current){o(),window.addEventListener("resize",o);const a=new ResizeObserver(()=>o());return a.observe(t.current),()=>{window.removeEventListener("resize",o),a&&t.current&&a.unobserve(t.current)}}},[])}const mc={position:"absolute",width:"100%",height:"100%",top:0,left:0},v5=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function b5({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:o=!0,panOnScroll:a=!1,panOnScrollSpeed:s=.5,panOnScrollMode:u=Mo.Free,zoomOnDoubleClick:f=!0,panOnDrag:h=!0,defaultViewport:p,translateExtent:m,minZoom:y,maxZoom:g,zoomActivationKeyCode:x,preventScrolling:_=!0,children:b,noWheelClassName:E,noPanClassName:C,onViewportChange:w,isControlledViewport:D,paneClickDistance:S,selectionOnDrag:N}){const O=et(),z=j.useRef(null),{userSelectionActive:B,lib:q,connectionInProgress:I}=He(v5,We),ae=fl(x),V=j.useRef();x5(z);const $=j.useCallback(ee=>{w?.({x:ee[0],y:ee[1],zoom:ee[2]}),D||O.setState({transform:ee})},[w,D]);return j.useEffect(()=>{if(z.current){V.current=wD({domNode:z.current,minZoom:y,maxZoom:g,translateExtent:m,viewport:p,onDraggingChange:R=>O.setState(H=>H.paneDragging===R?H:{paneDragging:R}),onPanZoomStart:(R,H)=>{const{onViewportChangeStart:F,onMoveStart:P}=O.getState();P?.(R,H),F?.(H)},onPanZoom:(R,H)=>{const{onViewportChange:F,onMove:P}=O.getState();P?.(R,H),F?.(H)},onPanZoomEnd:(R,H)=>{const{onViewportChangeEnd:F,onMoveEnd:P}=O.getState();P?.(R,H),F?.(H)}});const{x:ee,y:U,zoom:X}=V.current.getViewport();return O.setState({panZoom:V.current,transform:[ee,U,X],domNode:z.current.closest(".react-flow")}),()=>{V.current?.destroy()}}},[]),j.useEffect(()=>{V.current?.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:o,panOnScroll:a,panOnScrollSpeed:s,panOnScrollMode:u,zoomOnDoubleClick:f,panOnDrag:h,zoomActivationKeyPressed:ae,preventScrolling:_,noPanClassName:C,userSelectionActive:B,noWheelClassName:E,lib:q,onTransformChange:$,connectionInProgress:I,selectionOnDrag:N,paneClickDistance:S})},[t,r,o,a,s,u,f,h,ae,_,C,B,E,q,$,I,N,S]),A.jsx("div",{className:"react-flow__renderer",ref:z,style:mc,children:b})}const _5=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function E5(){const{userSelectionActive:t,userSelectionRect:r}=He(_5,We);return t&&r?A.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const rh=(t,r)=>o=>{o.target===r.current&&t?.(o)},S5=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function w5({isSelecting:t,selectionKeyPressed:r,selectionMode:o=sl.Full,panOnDrag:a,paneClickDistance:s,selectionOnDrag:u,onSelectionStart:f,onSelectionEnd:h,onPaneClick:p,onPaneContextMenu:m,onPaneScroll:y,onPaneMouseEnter:g,onPaneMouseMove:x,onPaneMouseLeave:_,children:b}){const E=et(),{userSelectionActive:C,elementsSelectable:w,dragging:D,connectionInProgress:S}=He(S5,We),N=w&&(t||C),O=j.useRef(null),z=j.useRef(),B=j.useRef(new Set),q=j.useRef(new Set),I=j.useRef(!1),ae=F=>{if(I.current||S){I.current=!1;return}p?.(F),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},V=F=>{if(Array.isArray(a)&&a?.includes(2)){F.preventDefault();return}m?.(F)},$=y?F=>y(F):void 0,ee=F=>{I.current&&(F.stopPropagation(),I.current=!1)},U=F=>{const{domNode:P}=E.getState();if(z.current=P?.getBoundingClientRect(),!z.current)return;const te=F.target===O.current;if(!te&&!!F.target.closest(".nokey")||!t||!(u&&te||r)||F.button!==0||!F.isPrimary)return;F.target?.setPointerCapture?.(F.pointerId),I.current=!1;const{x:W,y:ne}=bn(F.nativeEvent,z.current);E.setState({userSelectionRect:{width:0,height:0,startX:W,startY:ne,x:W,y:ne}}),te||(F.stopPropagation(),F.preventDefault())},X=F=>{const{userSelectionRect:P,transform:te,nodeLookup:M,edgeLookup:k,connectionLookup:W,triggerNodeChanges:ne,triggerEdgeChanges:se,defaultEdgeOptions:he,resetSelectedElements:ce}=E.getState();if(!z.current||!P)return;const{x:ue,y:de}=bn(F.nativeEvent,z.current),{startX:ge,startY:Se}=P;if(!I.current){const me=r?0:s;if(Math.hypot(ue-ge,de-Se)<=me)return;ce(),f?.(F)}I.current=!0;const be={startX:ge,startY:Se,x:ue<ge?ue:ge,y:de<Se?de:Se,width:Math.abs(ue-ge),height:Math.abs(de-Se)},Ee=B.current,oe=q.current;B.current=new Set(D0(M,be,te,o===sl.Partial,!0).map(me=>me.id)),q.current=new Set;const fe=he?.selectable??!0;for(const me of B.current){const Ce=W.get(me);if(Ce)for(const{edgeId:je}of Ce.values()){const Le=k.get(je);Le&&(Le.selectable??fe)&&q.current.add(je)}}if(!C1(Ee,B.current)){const me=Di(M,B.current,!0);ne(me)}if(!C1(oe,q.current)){const me=Di(k,q.current);se(me)}E.setState({userSelectionRect:be,userSelectionActive:!0,nodesSelectionActive:!1})},R=F=>{F.button===0&&(F.target?.releasePointerCapture?.(F.pointerId),!C&&F.target===O.current&&E.getState().userSelectionRect&&ae?.(F),E.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(h?.(F),E.setState({nodesSelectionActive:B.current.size>0})))},H=a===!0||Array.isArray(a)&&a.includes(0);return A.jsxs("div",{className:gt(["react-flow__pane",{draggable:H,dragging:D,selection:t}]),onClick:N?void 0:rh(ae,O),onContextMenu:rh(V,O),onWheel:rh($,O),onPointerEnter:N?void 0:g,onPointerMove:N?X:x,onPointerUp:N?R:void 0,onPointerDownCapture:N?U:void 0,onClickCapture:N?ee:void 0,onPointerLeave:_,ref:O,style:mc,children:[b,A.jsx(E5,{})]})}function Hh({id:t,store:r,unselect:o=!1,nodeRef:a}){const{addSelectedNodes:s,unselectNodesAndEdges:u,multiSelectionActive:f,nodeLookup:h,onError:p}=r.getState(),m=h.get(t);if(!m){p?.("012",Un.error012(t));return}r.setState({nodesSelectionActive:!1}),m.selected?(o||m.selected&&f)&&(u({nodes:[m],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):s([t])}function aE({nodeRef:t,disabled:r=!1,noDragClassName:o,handleSelector:a,nodeId:s,isSelectable:u,nodeClickDistance:f}){const h=et(),[p,m]=j.useState(!1),y=j.useRef();return j.useEffect(()=>{y.current=cD({getStoreItems:()=>h.getState(),onNodeMouseDown:g=>{Hh({id:g,store:h,nodeRef:t})},onDragStart:()=>{m(!0)},onDragStop:()=>{m(!1)}})},[]),j.useEffect(()=>{if(!(r||!t.current||!y.current))return y.current.update({noDragClassName:o,handleSelector:a,domNode:t.current,isSelectable:u,nodeId:s,nodeClickDistance:f}),()=>{y.current?.destroy()}},[o,a,r,u,t,s,f]),p}const A5=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function lE(){const t=et();return j.useCallback(o=>{const{nodeExtent:a,snapToGrid:s,snapGrid:u,nodesDraggable:f,onError:h,updateNodePositions:p,nodeLookup:m,nodeOrigin:y}=t.getState(),g=new Map,x=A5(f),_=s?u[0]:5,b=s?u[1]:5,E=o.direction.x*_*o.factor,C=o.direction.y*b*o.factor;for(const[,w]of m){if(!x(w))continue;let D={x:w.internals.positionAbsolute.x+E,y:w.internals.positionAbsolute.y+C};s&&(D=_l(D,u));const{position:S,positionAbsolute:N}=C_({nodeId:w.id,nextPosition:D,nodeLookup:m,nodeExtent:a,nodeOrigin:y,onError:h});w.position=S,w.internals.positionAbsolute=N,g.set(w.id,w)}p(g)},[])}const F0=j.createContext(null),T5=F0.Provider;F0.Consumer;const sE=()=>j.useContext(F0),C5=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),N5=(t,r,o)=>a=>{const{connectionClickStartHandle:s,connectionMode:u,connection:f}=a,{fromHandle:h,toHandle:p,isValid:m}=f,y=p?.nodeId===t&&p?.id===r&&p?.type===o;return{connectingFrom:h?.nodeId===t&&h?.id===r&&h?.type===o,connectingTo:y,clickConnecting:s?.nodeId===t&&s?.id===r&&s?.type===o,isPossibleEndHandle:u===ji.Strict?h?.type!==o:t!==h?.nodeId||r!==h?.id,connectionInProcess:!!h,clickConnectionInProcess:!!s,valid:y&&m}};function R5({type:t="source",position:r=xe.Top,isValidConnection:o,isConnectable:a=!0,isConnectableStart:s=!0,isConnectableEnd:u=!0,id:f,onConnect:h,children:p,className:m,onMouseDown:y,onTouchStart:g,...x},_){const b=f||null,E=t==="target",C=et(),w=sE(),{connectOnClick:D,noPanClassName:S,rfId:N}=He(C5,We),{connectingFrom:O,connectingTo:z,clickConnecting:B,isPossibleEndHandle:q,connectionInProcess:I,clickConnectionInProcess:ae,valid:V}=He(N5(w,b,t),We);w||C.getState().onError?.("010",Un.error010());const $=X=>{const{defaultEdgeOptions:R,onConnect:H,hasDefaultEdges:F}=C.getState(),P={...R,...X};if(F){const{edges:te,setEdges:M}=C.getState();M(Dh(P,te))}H?.(P),h?.(P)},ee=X=>{if(!w)return;const R=U_(X.nativeEvent);if(s&&(R&&X.button===0||!R)){const H=C.getState();Uh.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:H.autoPanOnConnect,connectionMode:H.connectionMode,connectionRadius:H.connectionRadius,domNode:H.domNode,nodeLookup:H.nodeLookup,lib:H.lib,isTarget:E,handleId:b,nodeId:w,flowId:H.rfId,panBy:H.panBy,cancelConnection:H.cancelConnection,onConnectStart:H.onConnectStart,onConnectEnd:(...F)=>C.getState().onConnectEnd?.(...F),updateConnection:H.updateConnection,onConnect:$,isValidConnection:o||((...F)=>C.getState().isValidConnection?.(...F)??!0),getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,autoPanSpeed:H.autoPanSpeed,dragThreshold:H.connectionDragThreshold})}R?y?.(X):g?.(X)},U=X=>{const{onClickConnectStart:R,onClickConnectEnd:H,connectionClickStartHandle:F,connectionMode:P,isValidConnection:te,lib:M,rfId:k,nodeLookup:W,connection:ne}=C.getState();if(!w||!F&&!s)return;if(!F){R?.(X.nativeEvent,{nodeId:w,handleId:b,handleType:t}),C.setState({connectionClickStartHandle:{nodeId:w,type:t,id:b}});return}const se=z_(X.target),he=o||te,{connection:ce,isValid:ue}=Uh.isValid(X.nativeEvent,{handle:{nodeId:w,id:b,type:t},connectionMode:P,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:he,flowId:k,doc:se,lib:M,nodeLookup:W});ue&&ce&&$(ce);const de=structuredClone(ne);delete de.inProgress,de.toPosition=de.toHandle?de.toHandle.position:null,H?.(X,de),C.setState({connectionClickStartHandle:null})};return A.jsx("div",{"data-handleid":b,"data-nodeid":w,"data-handlepos":r,"data-id":`${N}-${w}-${b}-${t}`,className:gt(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",S,m,{source:!E,target:E,connectable:a,connectablestart:s,connectableend:u,clickconnecting:B,connectingfrom:O,connectingto:z,valid:V,connectionindicator:a&&(!I||q)&&(I||ae?u:s)}]),onMouseDown:ee,onTouchStart:ee,onClick:D?U:void 0,ref:_,...x,children:p})}const dl=j.memo(oE(R5));function M5({data:t,isConnectable:r,sourcePosition:o=xe.Bottom}){return A.jsxs(A.Fragment,{children:[t?.label,A.jsx(dl,{type:"source",position:o,isConnectable:r})]})}function D5({data:t,isConnectable:r,targetPosition:o=xe.Top,sourcePosition:a=xe.Bottom}){return A.jsxs(A.Fragment,{children:[A.jsx(dl,{type:"target",position:o,isConnectable:r}),t?.label,A.jsx(dl,{type:"source",position:a,isConnectable:r})]})}function O5(){return null}function z5({data:t,isConnectable:r,targetPosition:o=xe.Top}){return A.jsxs(A.Fragment,{children:[A.jsx(dl,{type:"target",position:o,isConnectable:r}),t?.label]})}const Vu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},rv={input:M5,default:D5,output:z5,group:O5};function B5(t){return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??t.style?.width,height:t.height??t.initialHeight??t.style?.height}:{width:t.width??t.style?.width,height:t.height??t.style?.height}}const U5=t=>{const{width:r,height:o,x:a,y:s}=bl(t.nodeLookup,{filter:u=>!!u.selected});return{width:vn(r)?r:null,height:vn(o)?o:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${a}px,${s}px)`}};function H5({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:o}){const a=et(),{width:s,height:u,transformString:f,userSelectionActive:h}=He(U5,We),p=lE(),m=j.useRef(null);j.useEffect(()=>{o||m.current?.focus({preventScroll:!0})},[o]);const y=!h&&s!==null&&u!==null;if(aE({nodeRef:m,disabled:!y}),!y)return null;const g=t?_=>{const b=a.getState().nodes.filter(E=>E.selected);t(_,b)}:void 0,x=_=>{Object.prototype.hasOwnProperty.call(Vu,_.key)&&(_.preventDefault(),p({direction:Vu[_.key],factor:_.shiftKey?4:1}))};return A.jsx("div",{className:gt(["react-flow__nodesselection","react-flow__container",r]),style:{transform:f},children:A.jsx("div",{ref:m,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:o?void 0:-1,onKeyDown:o?void 0:x,style:{width:s,height:u}})})}const ov=typeof window<"u"?window:void 0,L5=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function uE({children:t,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:u,onPaneScroll:f,paneClickDistance:h,deleteKeyCode:p,selectionKeyCode:m,selectionOnDrag:y,selectionMode:g,onSelectionStart:x,onSelectionEnd:_,multiSelectionKeyCode:b,panActivationKeyCode:E,zoomActivationKeyCode:C,elementsSelectable:w,zoomOnScroll:D,zoomOnPinch:S,panOnScroll:N,panOnScrollSpeed:O,panOnScrollMode:z,zoomOnDoubleClick:B,panOnDrag:q,defaultViewport:I,translateExtent:ae,minZoom:V,maxZoom:$,preventScrolling:ee,onSelectionContextMenu:U,noWheelClassName:X,noPanClassName:R,disableKeyboardA11y:H,onViewportChange:F,isControlledViewport:P}){const{nodesSelectionActive:te,userSelectionActive:M}=He(L5,We),k=fl(m,{target:ov}),W=fl(E,{target:ov}),ne=W||q,se=W||N,he=y&&ne!==!0,ce=k||M||he;return y5({deleteKeyCode:p,multiSelectionKeyCode:b}),A.jsx(b5,{onPaneContextMenu:u,elementsSelectable:w,zoomOnScroll:D,zoomOnPinch:S,panOnScroll:se,panOnScrollSpeed:O,panOnScrollMode:z,zoomOnDoubleClick:B,panOnDrag:!k&&ne,defaultViewport:I,translateExtent:ae,minZoom:V,maxZoom:$,zoomActivationKeyCode:C,preventScrolling:ee,noWheelClassName:X,noPanClassName:R,onViewportChange:F,isControlledViewport:P,paneClickDistance:h,selectionOnDrag:he,children:A.jsxs(w5,{onSelectionStart:x,onSelectionEnd:_,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:u,onPaneScroll:f,panOnDrag:ne,isSelecting:!!ce,selectionMode:g,selectionKeyPressed:k,paneClickDistance:h,selectionOnDrag:he,children:[t,te&&A.jsx(H5,{onSelectionContextMenu:U,noPanClassName:R,disableKeyboardA11y:H})]})})}uE.displayName="FlowRenderer";const j5=j.memo(uE),F5=t=>r=>t?D0(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(o=>o.id):Array.from(r.nodeLookup.keys());function k5(t){return He(j.useCallback(F5(t),[t]),We)}const V5=t=>t.updateNodeInternals;function G5(){const t=He(V5),[r]=j.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(o=>{const a=new Map;o.forEach(s=>{const u=s.target.getAttribute("data-id");a.set(u,{id:u,nodeElement:s.target,force:!0})}),t(a)}));return j.useEffect(()=>()=>{r?.disconnect()},[r]),r}function q5({node:t,nodeType:r,hasDimensions:o,resizeObserver:a}){const s=et(),u=j.useRef(null),f=j.useRef(null),h=j.useRef(t.sourcePosition),p=j.useRef(t.targetPosition),m=j.useRef(r),y=o&&!!t.internals.handleBounds;return j.useEffect(()=>{u.current&&!t.hidden&&(!y||f.current!==u.current)&&(f.current&&a?.unobserve(f.current),a?.observe(u.current),f.current=u.current)},[y,t.hidden]),j.useEffect(()=>()=>{f.current&&(a?.unobserve(f.current),f.current=null)},[]),j.useEffect(()=>{if(u.current){const g=m.current!==r,x=h.current!==t.sourcePosition,_=p.current!==t.targetPosition;(g||x||_)&&(m.current=r,h.current=t.sourcePosition,p.current=t.targetPosition,s.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:u.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),u}function X5({id:t,onClick:r,onMouseEnter:o,onMouseMove:a,onMouseLeave:s,onContextMenu:u,onDoubleClick:f,nodesDraggable:h,elementsSelectable:p,nodesConnectable:m,nodesFocusable:y,resizeObserver:g,noDragClassName:x,noPanClassName:_,disableKeyboardA11y:b,rfId:E,nodeTypes:C,nodeClickDistance:w,onError:D}){const{node:S,internals:N,isParent:O}=He(ue=>{const de=ue.nodeLookup.get(t),ge=ue.parentLookup.has(t);return{node:de,internals:de.internals,isParent:ge}},We);let z=S.type||"default",B=C?.[z]||rv[z];B===void 0&&(D?.("003",Un.error003(z)),z="default",B=C?.default||rv.default);const q=!!(S.draggable||h&&typeof S.draggable>"u"),I=!!(S.selectable||p&&typeof S.selectable>"u"),ae=!!(S.connectable||m&&typeof S.connectable>"u"),V=!!(S.focusable||y&&typeof S.focusable>"u"),$=et(),ee=D_(S),U=q5({node:S,nodeType:z,hasDimensions:ee,resizeObserver:g}),X=aE({nodeRef:U,disabled:S.hidden||!q,noDragClassName:x,handleSelector:S.dragHandle,nodeId:t,isSelectable:I,nodeClickDistance:w}),R=lE();if(S.hidden)return null;const H=dr(S),F=B5(S),P=I||q||r||o||a||s,te=o?ue=>o(ue,{...N.userNode}):void 0,M=a?ue=>a(ue,{...N.userNode}):void 0,k=s?ue=>s(ue,{...N.userNode}):void 0,W=u?ue=>u(ue,{...N.userNode}):void 0,ne=f?ue=>f(ue,{...N.userNode}):void 0,se=ue=>{const{selectNodesOnDrag:de,nodeDragThreshold:ge}=$.getState();I&&(!de||!q||ge>0)&&Hh({id:t,store:$,nodeRef:U}),r&&r(ue,{...N.userNode})},he=ue=>{if(!(B_(ue.nativeEvent)||b)){if(__.includes(ue.key)&&I){const de=ue.key==="Escape";Hh({id:t,store:$,unselect:de,nodeRef:U})}else if(q&&S.selected&&Object.prototype.hasOwnProperty.call(Vu,ue.key)){ue.preventDefault();const{ariaLabelConfig:de}=$.getState();$.setState({ariaLiveMessage:de["node.a11yDescription.ariaLiveMessage"]({direction:ue.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),R({direction:Vu[ue.key],factor:ue.shiftKey?4:1})}}},ce=()=>{if(b||!U.current?.matches(":focus-visible"))return;const{transform:ue,width:de,height:ge,autoPanOnNodeFocus:Se,setCenter:be}=$.getState();if(!Se)return;D0(new Map([[t,S]]),{x:0,y:0,width:de,height:ge},ue,!0).length>0||be(S.position.x+H.width/2,S.position.y+H.height/2,{zoom:ue[2]})};return A.jsx("div",{className:gt(["react-flow__node",`react-flow__node-${z}`,{[_]:q},S.className,{selected:S.selected,selectable:I,parent:O,draggable:q,dragging:X}]),ref:U,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:ee?"visible":"hidden",...S.style,...F},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:te,onMouseMove:M,onMouseLeave:k,onContextMenu:W,onClick:se,onDoubleClick:ne,onKeyDown:V?he:void 0,tabIndex:V?0:void 0,onFocus:V?ce:void 0,role:S.ariaRole??(V?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${J_}-${E}`,"aria-label":S.ariaLabel,...S.domAttributes,children:A.jsx(T5,{value:t,children:A.jsx(B,{id:t,data:S.data,type:z,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:S.selected??!1,selectable:I,draggable:q,deletable:S.deletable??!0,isConnectable:ae,sourcePosition:S.sourcePosition,targetPosition:S.targetPosition,dragging:X,dragHandle:S.dragHandle,zIndex:N.z,parentId:S.parentId,...H})})})}var Y5=j.memo(X5);const I5=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function cE(t){const{nodesDraggable:r,nodesConnectable:o,nodesFocusable:a,elementsSelectable:s,onError:u}=He(I5,We),f=k5(t.onlyRenderVisibleElements),h=G5();return A.jsx("div",{className:"react-flow__nodes",style:mc,children:f.map(p=>A.jsx(Y5,{id:p,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:h,nodesDraggable:r,nodesConnectable:o,nodesFocusable:a,elementsSelectable:s,nodeClickDistance:t.nodeClickDistance,onError:u},p))})}cE.displayName="NodeRenderer";const P5=j.memo(cE);function $5(t){return He(j.useCallback(o=>{if(!t)return o.edges.map(s=>s.id);const a=[];if(o.width&&o.height)for(const s of o.edges){const u=o.nodeLookup.get(s.source),f=o.nodeLookup.get(s.target);u&&f&&I8({sourceNode:u,targetNode:f,width:o.width,height:o.height,transform:o.transform})&&a.push(s.id)}return a},[t]),We)}const Z5=({color:t="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...t&&{stroke:t}};return A.jsx("polyline",{className:"arrow",style:o,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Q5=({color:t="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...t&&{stroke:t,fill:t}};return A.jsx("polyline",{className:"arrowclosed",style:o,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},iv={[ju.Arrow]:Z5,[ju.ArrowClosed]:Q5};function K5(t){const r=et();return j.useMemo(()=>Object.prototype.hasOwnProperty.call(iv,t)?iv[t]:(r.getState().onError?.("009",Un.error009(t)),null),[t])}const J5=({id:t,type:r,color:o,width:a=12.5,height:s=12.5,markerUnits:u="strokeWidth",strokeWidth:f,orient:h="auto-start-reverse"})=>{const p=K5(r);return p?A.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${a}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:u,orient:h,refX:"0",refY:"0",children:A.jsx(p,{color:o,strokeWidth:f})}):null},fE=({defaultColor:t,rfId:r})=>{const o=He(u=>u.edges),a=He(u=>u.defaultEdgeOptions),s=j.useMemo(()=>W8(o,{id:r,defaultColor:t,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[o,a,r,t]);return s.length?A.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:A.jsx("defs",{children:s.map(u=>A.jsx(J5,{id:u.id,type:u.type,color:u.color,width:u.width,height:u.height,markerUnits:u.markerUnits,strokeWidth:u.strokeWidth,orient:u.orient},u.id))})}):null};fE.displayName="MarkerDefinitions";var W5=j.memo(fE);function dE({x:t,y:r,label:o,labelStyle:a,labelShowBg:s=!0,labelBgStyle:u,labelBgPadding:f=[2,4],labelBgBorderRadius:h=2,children:p,className:m,...y}){const[g,x]=j.useState({x:1,y:0,width:0,height:0}),_=gt(["react-flow__edge-textwrapper",m]),b=j.useRef(null);return j.useEffect(()=>{if(b.current){const E=b.current.getBBox();x({x:E.x,y:E.y,width:E.width,height:E.height})}},[o]),o?A.jsxs("g",{transform:`translate(${t-g.width/2} ${r-g.height/2})`,className:_,visibility:g.width?"visible":"hidden",...y,children:[s&&A.jsx("rect",{width:g.width+2*f[0],x:-f[0],y:-f[1],height:g.height+2*f[1],className:"react-flow__edge-textbg",style:u,rx:h,ry:h}),A.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:b,style:a,children:o}),p]}):null}dE.displayName="EdgeText";const e6=j.memo(dE);function Sl({path:t,labelX:r,labelY:o,label:a,labelStyle:s,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,interactionWidth:m=20,...y}){return A.jsxs(A.Fragment,{children:[A.jsx("path",{...y,d:t,fill:"none",className:gt(["react-flow__edge-path",y.className])}),m?A.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:m,className:"react-flow__edge-interaction"}):null,a&&vn(r)&&vn(o)?A.jsx(e6,{x:r,y:o,label:a,labelStyle:s,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p}):null]})}function av({pos:t,x1:r,y1:o,x2:a,y2:s}){return t===xe.Left||t===xe.Right?[.5*(r+a),o]:[r,.5*(o+s)]}function k0({sourceX:t,sourceY:r,sourcePosition:o=xe.Bottom,targetX:a,targetY:s,targetPosition:u=xe.Top}){const[f,h]=av({pos:o,x1:t,y1:r,x2:a,y2:s}),[p,m]=av({pos:u,x1:a,y1:s,x2:t,y2:r}),[y,g,x,_]=H_({sourceX:t,sourceY:r,targetX:a,targetY:s,sourceControlX:f,sourceControlY:h,targetControlX:p,targetControlY:m});return[`M${t},${r} C${f},${h} ${p},${m} ${a},${s}`,y,g,x,_]}function hE(t){return j.memo(({id:r,sourceX:o,sourceY:a,targetX:s,targetY:u,sourcePosition:f,targetPosition:h,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:_,style:b,markerEnd:E,markerStart:C,interactionWidth:w})=>{const[D,S,N]=k0({sourceX:o,sourceY:a,sourcePosition:f,targetX:s,targetY:u,targetPosition:h}),O=t.isInternal?void 0:r;return A.jsx(Sl,{id:O,path:D,labelX:S,labelY:N,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:_,style:b,markerEnd:E,markerStart:C,interactionWidth:w})})}const t6=hE({isInternal:!1}),mE=hE({isInternal:!0});t6.displayName="SimpleBezierEdge";mE.displayName="SimpleBezierEdgeInternal";function pE(t){return j.memo(({id:r,sourceX:o,sourceY:a,targetX:s,targetY:u,label:f,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:g,style:x,sourcePosition:_=xe.Bottom,targetPosition:b=xe.Top,markerEnd:E,markerStart:C,pathOptions:w,interactionWidth:D})=>{const[S,N,O]=Oh({sourceX:o,sourceY:a,sourcePosition:_,targetX:s,targetY:u,targetPosition:b,borderRadius:w?.borderRadius,offset:w?.offset,stepPosition:w?.stepPosition}),z=t.isInternal?void 0:r;return A.jsx(Sl,{id:z,path:S,labelX:N,labelY:O,label:f,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:g,style:x,markerEnd:E,markerStart:C,interactionWidth:D})})}const gE=pE({isInternal:!1}),yE=pE({isInternal:!0});gE.displayName="SmoothStepEdge";yE.displayName="SmoothStepEdgeInternal";function xE(t){return j.memo(({id:r,...o})=>{const a=t.isInternal?void 0:r;return A.jsx(gE,{...o,id:a,pathOptions:j.useMemo(()=>({borderRadius:0,offset:o.pathOptions?.offset}),[o.pathOptions?.offset])})})}const n6=xE({isInternal:!1}),vE=xE({isInternal:!0});n6.displayName="StepEdge";vE.displayName="StepEdgeInternal";function bE(t){return j.memo(({id:r,sourceX:o,sourceY:a,targetX:s,targetY:u,label:f,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:g,style:x,markerEnd:_,markerStart:b,interactionWidth:E})=>{const[C,w,D]=j_({sourceX:o,sourceY:a,targetX:s,targetY:u}),S=t.isInternal?void 0:r;return A.jsx(Sl,{id:S,path:C,labelX:w,labelY:D,label:f,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:g,style:x,markerEnd:_,markerStart:b,interactionWidth:E})})}const r6=bE({isInternal:!1}),_E=bE({isInternal:!0});r6.displayName="StraightEdge";_E.displayName="StraightEdgeInternal";function EE(t){return j.memo(({id:r,sourceX:o,sourceY:a,targetX:s,targetY:u,sourcePosition:f=xe.Bottom,targetPosition:h=xe.Top,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:_,style:b,markerEnd:E,markerStart:C,pathOptions:w,interactionWidth:D})=>{const[S,N,O]=cc({sourceX:o,sourceY:a,sourcePosition:f,targetX:s,targetY:u,targetPosition:h,curvature:w?.curvature}),z=t.isInternal?void 0:r;return A.jsx(Sl,{id:z,path:S,labelX:N,labelY:O,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:_,style:b,markerEnd:E,markerStart:C,interactionWidth:D})})}const o6=EE({isInternal:!1}),SE=EE({isInternal:!0});o6.displayName="BezierEdge";SE.displayName="BezierEdgeInternal";const lv={default:SE,straight:_E,step:vE,smoothstep:yE,simplebezier:mE},sv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},i6=(t,r,o)=>o===xe.Left?t-r:o===xe.Right?t+r:t,a6=(t,r,o)=>o===xe.Top?t-r:o===xe.Bottom?t+r:t,uv="react-flow__edgeupdater";function cv({position:t,centerX:r,centerY:o,radius:a=10,onMouseDown:s,onMouseEnter:u,onMouseOut:f,type:h}){return A.jsx("circle",{onMouseDown:s,onMouseEnter:u,onMouseOut:f,className:gt([uv,`${uv}-${h}`]),cx:i6(r,a,t),cy:a6(o,a,t),r:a,stroke:"transparent",fill:"transparent"})}function l6({isReconnectable:t,reconnectRadius:r,edge:o,sourceX:a,sourceY:s,targetX:u,targetY:f,sourcePosition:h,targetPosition:p,onReconnect:m,onReconnectStart:y,onReconnectEnd:g,setReconnecting:x,setUpdateHover:_}){const b=et(),E=(N,O)=>{if(N.button!==0)return;const{autoPanOnConnect:z,domNode:B,connectionMode:q,connectionRadius:I,lib:ae,onConnectStart:V,cancelConnection:$,nodeLookup:ee,rfId:U,panBy:X,updateConnection:R}=b.getState(),H=O.type==="target",F=(M,k)=>{x(!1),g?.(M,o,O.type,k)},P=M=>m?.(o,M),te=(M,k)=>{x(!0),y?.(N,o,O.type),V?.(M,k)};Uh.onPointerDown(N.nativeEvent,{autoPanOnConnect:z,connectionMode:q,connectionRadius:I,domNode:B,handleId:O.id,nodeId:O.nodeId,nodeLookup:ee,isTarget:H,edgeUpdaterType:O.type,lib:ae,flowId:U,cancelConnection:$,panBy:X,isValidConnection:(...M)=>b.getState().isValidConnection?.(...M)??!0,onConnect:P,onConnectStart:te,onConnectEnd:(...M)=>b.getState().onConnectEnd?.(...M),onReconnectEnd:F,updateConnection:R,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},C=N=>E(N,{nodeId:o.target,id:o.targetHandle??null,type:"target"}),w=N=>E(N,{nodeId:o.source,id:o.sourceHandle??null,type:"source"}),D=()=>_(!0),S=()=>_(!1);return A.jsxs(A.Fragment,{children:[(t===!0||t==="source")&&A.jsx(cv,{position:h,centerX:a,centerY:s,radius:r,onMouseDown:C,onMouseEnter:D,onMouseOut:S,type:"source"}),(t===!0||t==="target")&&A.jsx(cv,{position:p,centerX:u,centerY:f,radius:r,onMouseDown:w,onMouseEnter:D,onMouseOut:S,type:"target"})]})}function s6({id:t,edgesFocusable:r,edgesReconnectable:o,elementsSelectable:a,onClick:s,onDoubleClick:u,onContextMenu:f,onMouseEnter:h,onMouseMove:p,onMouseLeave:m,reconnectRadius:y,onReconnect:g,onReconnectStart:x,onReconnectEnd:_,rfId:b,edgeTypes:E,noPanClassName:C,onError:w,disableKeyboardA11y:D}){let S=He(be=>be.edgeLookup.get(t));const N=He(be=>be.defaultEdgeOptions);S=N?{...N,...S}:S;let O=S.type||"default",z=E?.[O]||lv[O];z===void 0&&(w?.("011",Un.error011(O)),O="default",z=E?.default||lv.default);const B=!!(S.focusable||r&&typeof S.focusable>"u"),q=typeof g<"u"&&(S.reconnectable||o&&typeof S.reconnectable>"u"),I=!!(S.selectable||a&&typeof S.selectable>"u"),ae=j.useRef(null),[V,$]=j.useState(!1),[ee,U]=j.useState(!1),X=et(),{zIndex:R,sourceX:H,sourceY:F,targetX:P,targetY:te,sourcePosition:M,targetPosition:k}=He(j.useCallback(be=>{const Ee=be.nodeLookup.get(S.source),oe=be.nodeLookup.get(S.target);if(!Ee||!oe)return{zIndex:S.zIndex,...sv};const fe=J8({id:t,sourceNode:Ee,targetNode:oe,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:be.connectionMode,onError:w});return{zIndex:Y8({selected:S.selected,zIndex:S.zIndex,sourceNode:Ee,targetNode:oe,elevateOnSelect:be.elevateEdgesOnSelect,zIndexMode:be.zIndexMode}),...fe||sv}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex]),We),W=j.useMemo(()=>S.markerStart?`url('#${zh(S.markerStart,b)}')`:void 0,[S.markerStart,b]),ne=j.useMemo(()=>S.markerEnd?`url('#${zh(S.markerEnd,b)}')`:void 0,[S.markerEnd,b]);if(S.hidden||H===null||F===null||P===null||te===null)return null;const se=be=>{const{addSelectedEdges:Ee,unselectNodesAndEdges:oe,multiSelectionActive:fe}=X.getState();I&&(X.setState({nodesSelectionActive:!1}),S.selected&&fe?(oe({nodes:[],edges:[S]}),ae.current?.blur()):Ee([t])),s&&s(be,S)},he=u?be=>{u(be,{...S})}:void 0,ce=f?be=>{f(be,{...S})}:void 0,ue=h?be=>{h(be,{...S})}:void 0,de=p?be=>{p(be,{...S})}:void 0,ge=m?be=>{m(be,{...S})}:void 0,Se=be=>{if(!D&&__.includes(be.key)&&I){const{unselectNodesAndEdges:Ee,addSelectedEdges:oe}=X.getState();be.key==="Escape"?(ae.current?.blur(),Ee({edges:[S]})):oe([t])}};return A.jsx("svg",{style:{zIndex:R},children:A.jsxs("g",{className:gt(["react-flow__edge",`react-flow__edge-${O}`,S.className,C,{selected:S.selected,animated:S.animated,inactive:!I&&!s,updating:V,selectable:I}]),onClick:se,onDoubleClick:he,onContextMenu:ce,onMouseEnter:ue,onMouseMove:de,onMouseLeave:ge,onKeyDown:B?Se:void 0,tabIndex:B?0:void 0,role:S.ariaRole??(B?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":S.ariaLabel===null?void 0:S.ariaLabel||`Edge from ${S.source} to ${S.target}`,"aria-describedby":B?`${W_}-${b}`:void 0,ref:ae,...S.domAttributes,children:[!ee&&A.jsx(z,{id:t,source:S.source,target:S.target,type:S.type,selected:S.selected,animated:S.animated,selectable:I,deletable:S.deletable??!0,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,sourceX:H,sourceY:F,targetX:P,targetY:te,sourcePosition:M,targetPosition:k,data:S.data,style:S.style,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerStart:W,markerEnd:ne,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth}),q&&A.jsx(l6,{edge:S,isReconnectable:q,reconnectRadius:y,onReconnect:g,onReconnectStart:x,onReconnectEnd:_,sourceX:H,sourceY:F,targetX:P,targetY:te,sourcePosition:M,targetPosition:k,setUpdateHover:$,setReconnecting:U})]})})}var u6=j.memo(s6);const c6=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function wE({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:o,edgeTypes:a,noPanClassName:s,onReconnect:u,onEdgeContextMenu:f,onEdgeMouseEnter:h,onEdgeMouseMove:p,onEdgeMouseLeave:m,onEdgeClick:y,reconnectRadius:g,onEdgeDoubleClick:x,onReconnectStart:_,onReconnectEnd:b,disableKeyboardA11y:E}){const{edgesFocusable:C,edgesReconnectable:w,elementsSelectable:D,onError:S}=He(c6,We),N=$5(r);return A.jsxs("div",{className:"react-flow__edges",children:[A.jsx(W5,{defaultColor:t,rfId:o}),N.map(O=>A.jsx(u6,{id:O,edgesFocusable:C,edgesReconnectable:w,elementsSelectable:D,noPanClassName:s,onReconnect:u,onContextMenu:f,onMouseEnter:h,onMouseMove:p,onMouseLeave:m,onClick:y,reconnectRadius:g,onDoubleClick:x,onReconnectStart:_,onReconnectEnd:b,rfId:o,onError:S,edgeTypes:a,disableKeyboardA11y:E},O))]})}wE.displayName="EdgeRenderer";const f6=j.memo(wE),d6=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function h6({children:t}){const r=He(d6);return A.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function m6(t){const r=hc(),o=j.useRef(!1);j.useEffect(()=>{!o.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),o.current=!0)},[t,r.viewportInitialized])}const p6=t=>t.panZoom?.syncViewport;function g6(t){const r=He(p6),o=et();return j.useEffect(()=>{t&&(r?.(t),o.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function y6(t){return t.connection.inProgress?{...t.connection,to:El(t.connection.to,t.transform)}:{...t.connection}}function x6(t){return y6}function v6(t){const r=x6();return He(r,We)}const b6=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function _6({containerStyle:t,style:r,type:o,component:a}){const{nodesConnectable:s,width:u,height:f,isValid:h,inProgress:p}=He(b6,We);return!(u&&s&&p)?null:A.jsx("svg",{style:t,width:u,height:f,className:"react-flow__connectionline react-flow__container",children:A.jsx("g",{className:gt(["react-flow__connection",w_(h)]),children:A.jsx(AE,{style:r,type:o,CustomComponent:a,isValid:h})})})}const AE=({style:t,type:r=Yr.Bezier,CustomComponent:o,isValid:a})=>{const{inProgress:s,from:u,fromNode:f,fromHandle:h,fromPosition:p,to:m,toNode:y,toHandle:g,toPosition:x,pointer:_}=v6();if(!s)return;if(o)return A.jsx(o,{connectionLineType:r,connectionLineStyle:t,fromNode:f,fromHandle:h,fromX:u.x,fromY:u.y,toX:m.x,toY:m.y,fromPosition:p,toPosition:x,connectionStatus:w_(a),toNode:y,toHandle:g,pointer:_});let b="";const E={sourceX:u.x,sourceY:u.y,sourcePosition:p,targetX:m.x,targetY:m.y,targetPosition:x};switch(r){case Yr.Bezier:[b]=cc(E);break;case Yr.SimpleBezier:[b]=k0(E);break;case Yr.Step:[b]=Oh({...E,borderRadius:0});break;case Yr.SmoothStep:[b]=Oh(E);break;default:[b]=j_(E)}return A.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:t})};AE.displayName="ConnectionLine";const E6={};function fv(t=E6){j.useRef(t),et(),j.useEffect(()=>{},[t])}function S6(){et(),j.useRef(!1),j.useEffect(()=>{},[])}function TE({nodeTypes:t,edgeTypes:r,onInit:o,onNodeClick:a,onEdgeClick:s,onNodeDoubleClick:u,onEdgeDoubleClick:f,onNodeMouseEnter:h,onNodeMouseMove:p,onNodeMouseLeave:m,onNodeContextMenu:y,onSelectionContextMenu:g,onSelectionStart:x,onSelectionEnd:_,connectionLineType:b,connectionLineStyle:E,connectionLineComponent:C,connectionLineContainerStyle:w,selectionKeyCode:D,selectionOnDrag:S,selectionMode:N,multiSelectionKeyCode:O,panActivationKeyCode:z,zoomActivationKeyCode:B,deleteKeyCode:q,onlyRenderVisibleElements:I,elementsSelectable:ae,defaultViewport:V,translateExtent:$,minZoom:ee,maxZoom:U,preventScrolling:X,defaultMarkerColor:R,zoomOnScroll:H,zoomOnPinch:F,panOnScroll:P,panOnScrollSpeed:te,panOnScrollMode:M,zoomOnDoubleClick:k,panOnDrag:W,onPaneClick:ne,onPaneMouseEnter:se,onPaneMouseMove:he,onPaneMouseLeave:ce,onPaneScroll:ue,onPaneContextMenu:de,paneClickDistance:ge,nodeClickDistance:Se,onEdgeContextMenu:be,onEdgeMouseEnter:Ee,onEdgeMouseMove:oe,onEdgeMouseLeave:fe,reconnectRadius:me,onReconnect:Ce,onReconnectStart:je,onReconnectEnd:Le,noDragClassName:tt,noWheelClassName:it,noPanClassName:$e,disableKeyboardA11y:Wt,nodeExtent:at,rfId:Wr,viewport:cn,onViewportChange:Sn}){return fv(t),fv(r),S6(),m6(o),g6(cn),A.jsx(j5,{onPaneClick:ne,onPaneMouseEnter:se,onPaneMouseMove:he,onPaneMouseLeave:ce,onPaneContextMenu:de,onPaneScroll:ue,paneClickDistance:ge,deleteKeyCode:q,selectionKeyCode:D,selectionOnDrag:S,selectionMode:N,onSelectionStart:x,onSelectionEnd:_,multiSelectionKeyCode:O,panActivationKeyCode:z,zoomActivationKeyCode:B,elementsSelectable:ae,zoomOnScroll:H,zoomOnPinch:F,zoomOnDoubleClick:k,panOnScroll:P,panOnScrollSpeed:te,panOnScrollMode:M,panOnDrag:W,defaultViewport:V,translateExtent:$,minZoom:ee,maxZoom:U,onSelectionContextMenu:g,preventScrolling:X,noDragClassName:tt,noWheelClassName:it,noPanClassName:$e,disableKeyboardA11y:Wt,onViewportChange:Sn,isControlledViewport:!!cn,children:A.jsxs(h6,{children:[A.jsx(f6,{edgeTypes:r,onEdgeClick:s,onEdgeDoubleClick:f,onReconnect:Ce,onReconnectStart:je,onReconnectEnd:Le,onlyRenderVisibleElements:I,onEdgeContextMenu:be,onEdgeMouseEnter:Ee,onEdgeMouseMove:oe,onEdgeMouseLeave:fe,reconnectRadius:me,defaultMarkerColor:R,noPanClassName:$e,disableKeyboardA11y:Wt,rfId:Wr}),A.jsx(_6,{style:E,type:b,component:C,containerStyle:w}),A.jsx("div",{className:"react-flow__edgelabel-renderer"}),A.jsx(P5,{nodeTypes:t,onNodeClick:a,onNodeDoubleClick:u,onNodeMouseEnter:h,onNodeMouseMove:p,onNodeMouseLeave:m,onNodeContextMenu:y,nodeClickDistance:Se,onlyRenderVisibleElements:I,noPanClassName:$e,noDragClassName:tt,disableKeyboardA11y:Wt,nodeExtent:at,rfId:Wr}),A.jsx("div",{className:"react-flow__viewport-portal"})]})})}TE.displayName="GraphView";const w6=j.memo(TE),dv=({nodes:t,edges:r,defaultNodes:o,defaultEdges:a,width:s,height:u,fitView:f,fitViewOptions:h,minZoom:p=.5,maxZoom:m=2,nodeOrigin:y,nodeExtent:g,zIndexMode:x="basic"}={})=>{const _=new Map,b=new Map,E=new Map,C=new Map,w=a??r??[],D=o??t??[],S=y??[0,0],N=g??ll;V_(E,C,w);const O=Bh(D,_,b,{nodeOrigin:S,nodeExtent:N,zIndexMode:x});let z=[0,0,1];if(f&&s&&u){const B=bl(_,{filter:V=>!!((V.width||V.initialWidth)&&(V.height||V.initialHeight))}),{x:q,y:I,zoom:ae}=O0(B,s,u,p,m,h?.padding??.1);z=[q,I,ae]}return{rfId:"1",width:s??0,height:u??0,transform:z,nodes:D,nodesInitialized:O,nodeLookup:_,parentLookup:b,edges:w,edgeLookup:C,connectionLookup:E,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:o!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:p,maxZoom:m,translateExtent:ll,nodeExtent:N,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ji.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:S,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:f??!1,fitViewOptions:h,fitViewResolver:null,connection:{...S_},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:F8,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:E_,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},A6=({nodes:t,edges:r,defaultNodes:o,defaultEdges:a,width:s,height:u,fitView:f,fitViewOptions:h,minZoom:p,maxZoom:m,nodeOrigin:y,nodeExtent:g,zIndexMode:x})=>GD((_,b)=>{async function E(){const{nodeLookup:C,panZoom:w,fitViewOptions:D,fitViewResolver:S,width:N,height:O,minZoom:z,maxZoom:B}=b();w&&(await L8({nodes:C,width:N,height:O,panZoom:w,minZoom:z,maxZoom:B},D),S?.resolve(!0),_({fitViewResolver:null}))}return{...dv({nodes:t,edges:r,width:s,height:u,fitView:f,fitViewOptions:h,minZoom:p,maxZoom:m,nodeOrigin:y,nodeExtent:g,defaultNodes:o,defaultEdges:a,zIndexMode:x}),setNodes:C=>{const{nodeLookup:w,parentLookup:D,nodeOrigin:S,elevateNodesOnSelect:N,fitViewQueued:O,zIndexMode:z}=b(),B=Bh(C,w,D,{nodeOrigin:S,nodeExtent:g,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:z});O&&B?(E(),_({nodes:C,nodesInitialized:B,fitViewQueued:!1,fitViewOptions:void 0})):_({nodes:C,nodesInitialized:B})},setEdges:C=>{const{connectionLookup:w,edgeLookup:D}=b();V_(w,D,C),_({edges:C})},setDefaultNodesAndEdges:(C,w)=>{if(C){const{setNodes:D}=b();D(C),_({hasDefaultNodes:!0})}if(w){const{setEdges:D}=b();D(w),_({hasDefaultEdges:!0})}},updateNodeInternals:C=>{const{triggerNodeChanges:w,nodeLookup:D,parentLookup:S,domNode:N,nodeOrigin:O,nodeExtent:z,debug:B,fitViewQueued:q,zIndexMode:I}=b(),{changes:ae,updatedInternals:V}=aD(C,D,S,N,O,z,I);V&&(nD(D,S,{nodeOrigin:O,nodeExtent:z,zIndexMode:I}),q?(E(),_({fitViewQueued:!1,fitViewOptions:void 0})):_({}),ae?.length>0&&(B&&console.log("React Flow: trigger node changes",ae),w?.(ae)))},updateNodePositions:(C,w=!1)=>{const D=[];let S=[];const{nodeLookup:N,triggerNodeChanges:O,connection:z,updateConnection:B,onNodesChangeMiddlewareMap:q}=b();for(const[I,ae]of C){const V=N.get(I),$=!!(V?.expandParent&&V?.parentId&&ae?.position),ee={id:I,type:"position",position:$?{x:Math.max(0,ae.position.x),y:Math.max(0,ae.position.y)}:ae.position,dragging:w};if(V&&z.inProgress&&z.fromNode.id===V.id){const U=Ho(V,z.fromHandle,xe.Left,!0);B({...z,from:U})}$&&V.parentId&&D.push({id:I,parentId:V.parentId,rect:{...ae.internals.positionAbsolute,width:ae.measured.width??0,height:ae.measured.height??0}}),S.push(ee)}if(D.length>0){const{parentLookup:I,nodeOrigin:ae}=b(),V=j0(D,N,I,ae);S.push(...V)}for(const I of q.values())S=I(S);O(S)},triggerNodeChanges:C=>{const{onNodesChange:w,setNodes:D,nodes:S,hasDefaultNodes:N,debug:O}=b();if(C?.length){if(N){const z=nE(C,S);D(z)}O&&console.log("React Flow: trigger node changes",C),w?.(C)}},triggerEdgeChanges:C=>{const{onEdgesChange:w,setEdges:D,edges:S,hasDefaultEdges:N,debug:O}=b();if(C?.length){if(N){const z=rE(C,S);D(z)}O&&console.log("React Flow: trigger edge changes",C),w?.(C)}},addSelectedNodes:C=>{const{multiSelectionActive:w,edgeLookup:D,nodeLookup:S,triggerNodeChanges:N,triggerEdgeChanges:O}=b();if(w){const z=C.map(B=>To(B,!0));N(z);return}N(Di(S,new Set([...C]),!0)),O(Di(D))},addSelectedEdges:C=>{const{multiSelectionActive:w,edgeLookup:D,nodeLookup:S,triggerNodeChanges:N,triggerEdgeChanges:O}=b();if(w){const z=C.map(B=>To(B,!0));O(z);return}O(Di(D,new Set([...C]))),N(Di(S,new Set,!0))},unselectNodesAndEdges:({nodes:C,edges:w}={})=>{const{edges:D,nodes:S,nodeLookup:N,triggerNodeChanges:O,triggerEdgeChanges:z}=b(),B=C||S,q=w||D,I=[];for(const V of B){if(!V.selected)continue;const $=N.get(V.id);$&&($.selected=!1),I.push(To(V.id,!1))}const ae=[];for(const V of q)V.selected&&ae.push(To(V.id,!1));O(I),z(ae)},setMinZoom:C=>{const{panZoom:w,maxZoom:D}=b();w?.setScaleExtent([C,D]),_({minZoom:C})},setMaxZoom:C=>{const{panZoom:w,minZoom:D}=b();w?.setScaleExtent([D,C]),_({maxZoom:C})},setTranslateExtent:C=>{b().panZoom?.setTranslateExtent(C),_({translateExtent:C})},resetSelectedElements:()=>{const{edges:C,nodes:w,triggerNodeChanges:D,triggerEdgeChanges:S,elementsSelectable:N}=b();if(!N)return;const O=w.reduce((B,q)=>q.selected?[...B,To(q.id,!1)]:B,[]),z=C.reduce((B,q)=>q.selected?[...B,To(q.id,!1)]:B,[]);D(O),S(z)},setNodeExtent:C=>{const{nodes:w,nodeLookup:D,parentLookup:S,nodeOrigin:N,elevateNodesOnSelect:O,nodeExtent:z,zIndexMode:B}=b();C[0][0]===z[0][0]&&C[0][1]===z[0][1]&&C[1][0]===z[1][0]&&C[1][1]===z[1][1]||(Bh(w,D,S,{nodeOrigin:N,nodeExtent:C,elevateNodesOnSelect:O,checkEquality:!1,zIndexMode:B}),_({nodeExtent:C}))},panBy:C=>{const{transform:w,width:D,height:S,panZoom:N,translateExtent:O}=b();return lD({delta:C,panZoom:N,transform:w,translateExtent:O,width:D,height:S})},setCenter:async(C,w,D)=>{const{width:S,height:N,maxZoom:O,panZoom:z}=b();if(!z)return Promise.resolve(!1);const B=typeof D?.zoom<"u"?D.zoom:O;return await z.setViewport({x:S/2-C*B,y:N/2-w*B,zoom:B},{duration:D?.duration,ease:D?.ease,interpolate:D?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{_({connection:{...S_}})},updateConnection:C=>{_({connection:C})},reset:()=>_({...dv()})}},Object.is);function CE({initialNodes:t,initialEdges:r,defaultNodes:o,defaultEdges:a,initialWidth:s,initialHeight:u,initialMinZoom:f,initialMaxZoom:h,initialFitViewOptions:p,fitView:m,nodeOrigin:y,nodeExtent:g,zIndexMode:x,children:_}){const[b]=j.useState(()=>A6({nodes:t,edges:r,defaultNodes:o,defaultEdges:a,width:s,height:u,fitView:m,minZoom:f,maxZoom:h,fitViewOptions:p,nodeOrigin:y,nodeExtent:g,zIndexMode:x}));return A.jsx(XD,{value:b,children:A.jsx(h5,{children:_})})}function T6({children:t,nodes:r,edges:o,defaultNodes:a,defaultEdges:s,width:u,height:f,fitView:h,fitViewOptions:p,minZoom:m,maxZoom:y,nodeOrigin:g,nodeExtent:x,zIndexMode:_}){return j.useContext(dc)?A.jsx(A.Fragment,{children:t}):A.jsx(CE,{initialNodes:r,initialEdges:o,defaultNodes:a,defaultEdges:s,initialWidth:u,initialHeight:f,fitView:h,initialFitViewOptions:p,initialMinZoom:m,initialMaxZoom:y,nodeOrigin:g,nodeExtent:x,zIndexMode:_,children:t})}const C6={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function N6({nodes:t,edges:r,defaultNodes:o,defaultEdges:a,className:s,nodeTypes:u,edgeTypes:f,onNodeClick:h,onEdgeClick:p,onInit:m,onMove:y,onMoveStart:g,onMoveEnd:x,onConnect:_,onConnectStart:b,onConnectEnd:E,onClickConnectStart:C,onClickConnectEnd:w,onNodeMouseEnter:D,onNodeMouseMove:S,onNodeMouseLeave:N,onNodeContextMenu:O,onNodeDoubleClick:z,onNodeDragStart:B,onNodeDrag:q,onNodeDragStop:I,onNodesDelete:ae,onEdgesDelete:V,onDelete:$,onSelectionChange:ee,onSelectionDragStart:U,onSelectionDrag:X,onSelectionDragStop:R,onSelectionContextMenu:H,onSelectionStart:F,onSelectionEnd:P,onBeforeDelete:te,connectionMode:M,connectionLineType:k=Yr.Bezier,connectionLineStyle:W,connectionLineComponent:ne,connectionLineContainerStyle:se,deleteKeyCode:he="Backspace",selectionKeyCode:ce="Shift",selectionOnDrag:ue=!1,selectionMode:de=sl.Full,panActivationKeyCode:ge="Space",multiSelectionKeyCode:Se=cl()?"Meta":"Control",zoomActivationKeyCode:be=cl()?"Meta":"Control",snapToGrid:Ee,snapGrid:oe,onlyRenderVisibleElements:fe=!1,selectNodesOnDrag:me,nodesDraggable:Ce,autoPanOnNodeFocus:je,nodesConnectable:Le,nodesFocusable:tt,nodeOrigin:it=eE,edgesFocusable:$e,edgesReconnectable:Wt,elementsSelectable:at=!0,defaultViewport:Wr=r5,minZoom:cn=.5,maxZoom:Sn=2,translateExtent:Nt=ll,preventScrolling:eo=!0,nodeExtent:hr,defaultMarkerColor:Yi="#b1b1b7",zoomOnScroll:Ii=!0,zoomOnPinch:to=!0,panOnScroll:Rt=!1,panOnScrollSpeed:wn=.5,panOnScrollMode:Mt=Mo.Free,zoomOnDoubleClick:gc=!0,panOnDrag:yc=!0,onPaneClick:xc,onPaneMouseEnter:Fo,onPaneMouseMove:ko,onPaneMouseLeave:Vo,onPaneScroll:kn,onPaneContextMenu:Go,paneClickDistance:no=1,nodeClickDistance:vc=0,children:Al,onReconnect:Pi,onReconnectStart:ro,onReconnectEnd:bc,onEdgeContextMenu:Tl,onEdgeDoubleClick:Cl,onEdgeMouseEnter:Nl,onEdgeMouseMove:$i,onEdgeMouseLeave:Zi,reconnectRadius:Rl=10,onNodesChange:Ml,onEdgesChange:An,noDragClassName:yt="nodrag",noWheelClassName:At="nowheel",noPanClassName:Vn="nopan",fitView:qo,fitViewOptions:Dl,connectOnClick:_c,attributionPosition:Ol,proOptions:oo,defaultEdgeOptions:Qi,elevateNodesOnSelect:mr=!0,elevateEdgesOnSelect:pr=!1,disableKeyboardA11y:gr=!1,autoPanOnConnect:yr,autoPanOnNodeDrag:ut,autoPanSpeed:zl,connectionRadius:Bl,isValidConnection:Gn,onError:xr,style:Ec,id:Ki,nodeDragThreshold:Ul,connectionDragThreshold:Sc,viewport:Xo,onViewportChange:Yo,width:fn,height:Bt,colorMode:Hl="light",debug:wc,onScroll:Io,ariaLabelConfig:Ll,zIndexMode:io="basic",...Ac},Ut){const ao=Ki||"1",jl=l5(Hl),Ji=j.useCallback(qn=>{qn.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Io?.(qn)},[Io]);return A.jsx("div",{"data-testid":"rf__wrapper",...Ac,onScroll:Ji,style:{...Ec,...C6},ref:Ut,className:gt(["react-flow",s,jl]),id:Ki,role:"application",children:A.jsxs(T6,{nodes:t,edges:r,width:fn,height:Bt,fitView:qo,fitViewOptions:Dl,minZoom:cn,maxZoom:Sn,nodeOrigin:it,nodeExtent:hr,zIndexMode:io,children:[A.jsx(w6,{onInit:m,onNodeClick:h,onEdgeClick:p,onNodeMouseEnter:D,onNodeMouseMove:S,onNodeMouseLeave:N,onNodeContextMenu:O,onNodeDoubleClick:z,nodeTypes:u,edgeTypes:f,connectionLineType:k,connectionLineStyle:W,connectionLineComponent:ne,connectionLineContainerStyle:se,selectionKeyCode:ce,selectionOnDrag:ue,selectionMode:de,deleteKeyCode:he,multiSelectionKeyCode:Se,panActivationKeyCode:ge,zoomActivationKeyCode:be,onlyRenderVisibleElements:fe,defaultViewport:Wr,translateExtent:Nt,minZoom:cn,maxZoom:Sn,preventScrolling:eo,zoomOnScroll:Ii,zoomOnPinch:to,zoomOnDoubleClick:gc,panOnScroll:Rt,panOnScrollSpeed:wn,panOnScrollMode:Mt,panOnDrag:yc,onPaneClick:xc,onPaneMouseEnter:Fo,onPaneMouseMove:ko,onPaneMouseLeave:Vo,onPaneScroll:kn,onPaneContextMenu:Go,paneClickDistance:no,nodeClickDistance:vc,onSelectionContextMenu:H,onSelectionStart:F,onSelectionEnd:P,onReconnect:Pi,onReconnectStart:ro,onReconnectEnd:bc,onEdgeContextMenu:Tl,onEdgeDoubleClick:Cl,onEdgeMouseEnter:Nl,onEdgeMouseMove:$i,onEdgeMouseLeave:Zi,reconnectRadius:Rl,defaultMarkerColor:Yi,noDragClassName:yt,noWheelClassName:At,noPanClassName:Vn,rfId:ao,disableKeyboardA11y:gr,nodeExtent:hr,viewport:Xo,onViewportChange:Yo}),A.jsx(a5,{nodes:t,edges:r,defaultNodes:o,defaultEdges:a,onConnect:_,onConnectStart:b,onConnectEnd:E,onClickConnectStart:C,onClickConnectEnd:w,nodesDraggable:Ce,autoPanOnNodeFocus:je,nodesConnectable:Le,nodesFocusable:tt,edgesFocusable:$e,edgesReconnectable:Wt,elementsSelectable:at,elevateNodesOnSelect:mr,elevateEdgesOnSelect:pr,minZoom:cn,maxZoom:Sn,nodeExtent:hr,onNodesChange:Ml,onEdgesChange:An,snapToGrid:Ee,snapGrid:oe,connectionMode:M,translateExtent:Nt,connectOnClick:_c,defaultEdgeOptions:Qi,fitView:qo,fitViewOptions:Dl,onNodesDelete:ae,onEdgesDelete:V,onDelete:$,onNodeDragStart:B,onNodeDrag:q,onNodeDragStop:I,onSelectionDrag:X,onSelectionDragStart:U,onSelectionDragStop:R,onMove:y,onMoveStart:g,onMoveEnd:x,noPanClassName:Vn,nodeOrigin:it,rfId:ao,autoPanOnConnect:yr,autoPanOnNodeDrag:ut,autoPanSpeed:zl,onError:xr,connectionRadius:Bl,isValidConnection:Gn,selectNodesOnDrag:me,nodeDragThreshold:Ul,connectionDragThreshold:Sc,onBeforeDelete:te,debug:wc,ariaLabelConfig:Ll,zIndexMode:io}),A.jsx(n5,{onSelectionChange:ee}),Al,A.jsx(KD,{proOptions:oo,position:Ol}),A.jsx(QD,{rfId:ao,disableKeyboardA11y:gr})]})})}var R6=oE(N6);const M6=t=>t.domNode?.querySelector(".react-flow__edgelabel-renderer");function D6({children:t}){const r=He(M6);return r?qD.createPortal(t,r):null}function O6({dimensions:t,lineWidth:r,variant:o,className:a}){return A.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:gt(["react-flow__background-pattern",o,a])})}function z6({radius:t,className:r}){return A.jsx("circle",{cx:t,cy:t,r:t,className:gt(["react-flow__background-pattern","dots",r])})}var Zr;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Zr||(Zr={}));const B6={[Zr.Dots]:1,[Zr.Lines]:1,[Zr.Cross]:6},U6=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function NE({id:t,variant:r=Zr.Dots,gap:o=20,size:a,lineWidth:s=1,offset:u=0,color:f,bgColor:h,style:p,className:m,patternClassName:y}){const g=j.useRef(null),{transform:x,patternId:_}=He(U6,We),b=a||B6[r],E=r===Zr.Dots,C=r===Zr.Cross,w=Array.isArray(o)?o:[o,o],D=[w[0]*x[2]||1,w[1]*x[2]||1],S=b*x[2],N=Array.isArray(u)?u:[u,u],O=C?[S,S]:D,z=[N[0]*x[2]||1+O[0]/2,N[1]*x[2]||1+O[1]/2],B=`${_}${t||""}`;return A.jsxs("svg",{className:gt(["react-flow__background",m]),style:{...p,...mc,"--xy-background-color-props":h,"--xy-background-pattern-color-props":f},ref:g,"data-testid":"rf__background",children:[A.jsx("pattern",{id:B,x:x[0]%D[0],y:x[1]%D[1],width:D[0],height:D[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${z[0]},-${z[1]})`,children:E?A.jsx(z6,{radius:S/2,className:y}):A.jsx(O6,{dimensions:O,lineWidth:s,variant:r,className:y})}),A.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${B})`})]})}NE.displayName="Background";j.memo(NE);function H6(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:A.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function L6(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:A.jsx("path",{d:"M0 0h32v4.2H0z"})})}function j6(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:A.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function F6(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:A.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function k6(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:A.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function cu({children:t,className:r,...o}){return A.jsx("button",{type:"button",className:gt(["react-flow__controls-button",r]),...o,children:t})}const V6=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function RE({style:t,showZoom:r=!0,showFitView:o=!0,showInteractive:a=!0,fitViewOptions:s,onZoomIn:u,onZoomOut:f,onFitView:h,onInteractiveChange:p,className:m,children:y,position:g="bottom-left",orientation:x="vertical","aria-label":_}){const b=et(),{isInteractive:E,minZoomReached:C,maxZoomReached:w,ariaLabelConfig:D}=He(V6,We),{zoomIn:S,zoomOut:N,fitView:O}=hc(),z=()=>{S(),u?.()},B=()=>{N(),f?.()},q=()=>{O(s),h?.()},I=()=>{b.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),p?.(!E)},ae=x==="horizontal"?"horizontal":"vertical";return A.jsxs(Do,{className:gt(["react-flow__controls",ae,m]),position:g,style:t,"data-testid":"rf__controls","aria-label":_??D["controls.ariaLabel"],children:[r&&A.jsxs(A.Fragment,{children:[A.jsx(cu,{onClick:z,className:"react-flow__controls-zoomin",title:D["controls.zoomIn.ariaLabel"],"aria-label":D["controls.zoomIn.ariaLabel"],disabled:w,children:A.jsx(H6,{})}),A.jsx(cu,{onClick:B,className:"react-flow__controls-zoomout",title:D["controls.zoomOut.ariaLabel"],"aria-label":D["controls.zoomOut.ariaLabel"],disabled:C,children:A.jsx(L6,{})})]}),o&&A.jsx(cu,{className:"react-flow__controls-fitview",onClick:q,title:D["controls.fitView.ariaLabel"],"aria-label":D["controls.fitView.ariaLabel"],children:A.jsx(j6,{})}),a&&A.jsx(cu,{className:"react-flow__controls-interactive",onClick:I,title:D["controls.interactive.ariaLabel"],"aria-label":D["controls.interactive.ariaLabel"],children:E?A.jsx(k6,{}):A.jsx(F6,{})}),y]})}RE.displayName="Controls";const G6=j.memo(RE);function q6({id:t,x:r,y:o,width:a,height:s,style:u,color:f,strokeColor:h,strokeWidth:p,className:m,borderRadius:y,shapeRendering:g,selected:x,onClick:_}){const{background:b,backgroundColor:E}=u||{},C=f||b||E;return A.jsx("rect",{className:gt(["react-flow__minimap-node",{selected:x},m]),x:r,y:o,rx:y,ry:y,width:a,height:s,style:{fill:C,stroke:h,strokeWidth:p},shapeRendering:g,onClick:_?w=>_(w,t):void 0})}const X6=j.memo(q6),Y6=t=>t.nodes.map(r=>r.id),oh=t=>t instanceof Function?t:()=>t;function I6({nodeStrokeColor:t,nodeColor:r,nodeClassName:o="",nodeBorderRadius:a=5,nodeStrokeWidth:s,nodeComponent:u=X6,onClick:f}){const h=He(Y6,We),p=oh(r),m=oh(t),y=oh(o),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return A.jsx(A.Fragment,{children:h.map(x=>A.jsx($6,{id:x,nodeColorFunc:p,nodeStrokeColorFunc:m,nodeClassNameFunc:y,nodeBorderRadius:a,nodeStrokeWidth:s,NodeComponent:u,onClick:f,shapeRendering:g},x))})}function P6({id:t,nodeColorFunc:r,nodeStrokeColorFunc:o,nodeClassNameFunc:a,nodeBorderRadius:s,nodeStrokeWidth:u,shapeRendering:f,NodeComponent:h,onClick:p}){const{node:m,x:y,y:g,width:x,height:_}=He(b=>{const E=b.nodeLookup.get(t);if(!E)return{node:void 0,x:0,y:0,width:0,height:0};const C=E.internals.userNode,{x:w,y:D}=E.internals.positionAbsolute,{width:S,height:N}=dr(C);return{node:C,x:w,y:D,width:S,height:N}},We);return!m||m.hidden||!D_(m)?null:A.jsx(h,{x:y,y:g,width:x,height:_,style:m.style,selected:!!m.selected,className:a(m),color:r(m),borderRadius:s,strokeColor:o(m),strokeWidth:u,shapeRendering:f,onClick:p,id:m.id})}const $6=j.memo(P6);var Z6=j.memo(I6);const Q6=200,K6=150,J6=t=>!t.hidden,W6=t=>{const r={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:r,boundingRect:t.nodeLookup.size>0?M_(bl(t.nodeLookup,{filter:J6}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},eO="react-flow__minimap-desc";function ME({style:t,className:r,nodeStrokeColor:o,nodeColor:a,nodeClassName:s="",nodeBorderRadius:u=5,nodeStrokeWidth:f,nodeComponent:h,bgColor:p,maskColor:m,maskStrokeColor:y,maskStrokeWidth:g,position:x="bottom-right",onClick:_,onNodeClick:b,pannable:E=!1,zoomable:C=!1,ariaLabel:w,inversePan:D,zoomStep:S=1,offsetScale:N=5}){const O=et(),z=j.useRef(null),{boundingRect:B,viewBB:q,rfId:I,panZoom:ae,translateExtent:V,flowWidth:$,flowHeight:ee,ariaLabelConfig:U}=He(W6,We),X=t?.width??Q6,R=t?.height??K6,H=B.width/X,F=B.height/R,P=Math.max(H,F),te=P*X,M=P*R,k=N*P,W=B.x-(te-B.width)/2-k,ne=B.y-(M-B.height)/2-k,se=te+k*2,he=M+k*2,ce=`${eO}-${I}`,ue=j.useRef(0),de=j.useRef();ue.current=P,j.useEffect(()=>{if(z.current&&ae)return de.current=gD({domNode:z.current,panZoom:ae,getTransform:()=>O.getState().transform,getViewScale:()=>ue.current}),()=>{de.current?.destroy()}},[ae]),j.useEffect(()=>{de.current?.update({translateExtent:V,width:$,height:ee,inversePan:D,pannable:E,zoomStep:S,zoomable:C})},[E,C,D,S,V,$,ee]);const ge=_?Ee=>{const[oe,fe]=de.current?.pointer(Ee)||[0,0];_(Ee,{x:oe,y:fe})}:void 0,Se=b?j.useCallback((Ee,oe)=>{const fe=O.getState().nodeLookup.get(oe).internals.userNode;b(Ee,fe)},[]):void 0,be=w??U["minimap.ariaLabel"];return A.jsx(Do,{position:x,style:{...t,"--xy-minimap-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-background-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-color-props":typeof y=="string"?y:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*P:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-width-props":typeof f=="number"?f:void 0},className:gt(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:A.jsxs("svg",{width:X,height:R,viewBox:`${W} ${ne} ${se} ${he}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ce,ref:z,onClick:ge,children:[be&&A.jsx("title",{id:ce,children:be}),A.jsx(Z6,{onClick:Se,nodeColor:a,nodeStrokeColor:o,nodeBorderRadius:u,nodeClassName:s,nodeStrokeWidth:f,nodeComponent:h}),A.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-k},${ne-k}h${se+k*2}v${he+k*2}h${-se-k*2}z
|
|
895
|
+
M${q.x},${q.y}h${q.width}v${q.height}h${-q.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ME.displayName="MiniMap";j.memo(ME);const tO=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,nO={[Gi.Line]:"right",[Gi.Handle]:"bottom-right"};function rO({nodeId:t,position:r,variant:o=Gi.Handle,className:a,style:s=void 0,children:u,color:f,minWidth:h=10,minHeight:p=10,maxWidth:m=Number.MAX_VALUE,maxHeight:y=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:x,autoScale:_=!0,shouldResize:b,onResizeStart:E,onResize:C,onResizeEnd:w}){const D=sE(),S=typeof t=="string"?t:D,N=et(),O=j.useRef(null),z=o===Gi.Handle,B=He(j.useCallback(tO(z&&_),[z,_]),We),q=j.useRef(null),I=r??nO[o];j.useEffect(()=>{if(!(!O.current||!S))return q.current||(q.current=MD({domNode:O.current,nodeId:S,getStoreItems:()=>{const{nodeLookup:V,transform:$,snapGrid:ee,snapToGrid:U,nodeOrigin:X,domNode:R}=N.getState();return{nodeLookup:V,transform:$,snapGrid:ee,snapToGrid:U,nodeOrigin:X,paneDomNode:R}},onChange:(V,$)=>{const{triggerNodeChanges:ee,nodeLookup:U,parentLookup:X,nodeOrigin:R}=N.getState(),H=[],F={x:V.x,y:V.y},P=U.get(S);if(P&&P.expandParent&&P.parentId){const te=P.origin??R,M=V.width??P.measured.width??0,k=V.height??P.measured.height??0,W={id:P.id,parentId:P.parentId,rect:{width:M,height:k,...O_({x:V.x??P.position.x,y:V.y??P.position.y},{width:M,height:k},P.parentId,U,te)}},ne=j0([W],U,X,R);H.push(...ne),F.x=V.x?Math.max(te[0]*M,V.x):void 0,F.y=V.y?Math.max(te[1]*k,V.y):void 0}if(F.x!==void 0&&F.y!==void 0){const te={id:S,type:"position",position:{...F}};H.push(te)}if(V.width!==void 0&&V.height!==void 0){const M={id:S,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:V.width,height:V.height}};H.push(M)}for(const te of $){const M={...te,type:"position"};H.push(M)}ee(H)},onEnd:({width:V,height:$})=>{const ee={id:S,type:"dimensions",resizing:!1,dimensions:{width:V,height:$}};N.getState().triggerNodeChanges([ee])}})),q.current.update({controlPosition:I,boundaries:{minWidth:h,minHeight:p,maxWidth:m,maxHeight:y},keepAspectRatio:g,resizeDirection:x,onResizeStart:E,onResize:C,onResizeEnd:w,shouldResize:b}),()=>{q.current?.destroy()}},[I,h,p,m,y,g,E,C,w,b]);const ae=I.split("-");return A.jsx("div",{className:gt(["react-flow__resize-control","nodrag",...ae,o,a]),ref:O,style:{...s,scale:B,...f&&{[z?"backgroundColor":"borderColor"]:f}},children:u})}j.memo(rO);const ih=14,hv=50,mv=({id:t,type:r,position:o,count:a})=>{const s=r==="source";let u;return s?u="bg-neutral-300 text-neutral-500 hover:border-neutral-500 hover:text-neutral-800 bg-[#78A3C4]":u="bg-neutral-300",A.jsx(dl,{id:t,type:r,position:o,className:`${o===xe.Top?"top-0 ":o===xe.Bottom?"bottom-0":""}`,style:{background:"none",border:"none",width:ih*2,height:ih,...a?{transform:`translateX(${a.index/(a.total-1)*hv-hv/2-ih}px)`}:{}},children:A.jsx("div",{className:`absolute inset-0 rounded-full flex items-center justify-center text-xs font-mono leading-none pointer-events-none transition-colors ${u}`})})},Hn=({value:t,min:r=-1/0,max:o=1/0,step:a=.01,label:s,onChange:u})=>{const f=j.useRef(!1),h=j.useRef(0),p=j.useRef(0),[m,y]=j.useState(!1),[g,x]=j.useState(""),_=j.useRef(null),b=j.useRef(null),E=O=>Math.min(o,Math.max(r,O)),C=j.useCallback(O=>{m||(f.current=!0,h.current=O.clientX,p.current=t,O.preventDefault())},[t,m]);j.useEffect(()=>{const O=B=>{if(!f.current)return;const q=(B.clientX-h.current)*a;u(E(parseFloat((p.current+q).toFixed(6))))},z=()=>{f.current=!1};return window.addEventListener("mousemove",O),window.addEventListener("mouseup",z),()=>{window.removeEventListener("mousemove",O),window.removeEventListener("mouseup",z)}},[a,r,o,u]);const w=()=>{x(String(t)),y(!0),setTimeout(()=>_.current?.select(),0)},D=()=>{const O=parseFloat(g);isNaN(O)||u(E(O)),y(!1)},S=O=>{m||(O.key==="Enter"||O.key===" "?(O.preventDefault(),x(String(t)),y(!0),setTimeout(()=>_.current?.select(),0)):O.key==="ArrowRight"||O.key==="ArrowUp"?(O.preventDefault(),u(E(parseFloat((t+a).toFixed(6))))):(O.key==="ArrowLeft"||O.key==="ArrowDown")&&(O.preventDefault(),u(E(parseFloat((t-a).toFixed(6))))))},N=Number.isInteger(t)?t.toFixed(1):t.toFixed(3).replace(/0+$/,"");return A.jsxs("div",{className:"flex items-center w-20 relative nodrag",children:[s&&A.jsx("span",{className:"absolute left-1 z-10 bg-neutral-200 h-4 w-4 grid place-items-center pointer-events-none rounded-sm",children:A.jsx("p",{className:"text-[11px] font-mono w-3 text-neutral-500 height-3 leading-0 -translate-y-0.5 translate-x-0.5 ",children:s})}),A.jsx("div",{ref:b,tabIndex:0,onMouseDown:C,onDoubleClick:w,onKeyDown:S,className:["flex items-center justify-center","rounded overflow-hidden select-none w-full h-6","focus:outline-2 focus:outline-neutral-400 focus:outline-offset-1",m?"cursor-text":"cursor-ew-resize"].join(" "),children:m?A.jsx("input",{ref:_,value:g,onChange:O=>x(O.target.value),onBlur:D,onKeyDown:O=>{O.key==="Enter"&&D(),O.key==="Escape"&&y(!1)},className:"outline-none text-neutral-500 text-xs font-mono border-neutral-200 pl-5 rounded-sm text-right w-full h-full bg-white"}):A.jsx("span",{className:"text-xs font-mono text-neutral-500 pl-5 pointer-events-none border-neutral-200 bg-white rounded-sm w-full h-full flex items-center justify-end px-1",children:A.jsx("p",{children:N})})})]})},wl=j.createContext({currentTime:{current:0},mousePosition:{current:[0,0]},shaders:[],patches:{},showStats:!1,openExportNodeId:null,setOpenExportNodeId:()=>{},openPreviewNodeId:null,setOpenPreviewNodeId:()=>{},uniforms:{current:{}},handleUpdateUniforms:()=>{},handleUpdateNode:t=>t,handleInsertShader:()=>{}}),ah=t=>Math.round(Math.min(1,Math.max(0,t))*255).toString(16).padStart(2,"0"),lh=t=>parseInt(t,16)/255,DE=([t,r,o])=>`#${ah(t)}${ah(r)}${ah(o)}`,OE=t=>[lh(t.slice(1,3)),lh(t.slice(3,5)),lh(t.slice(5,7))],V0=({color:t,onChange:r})=>{const o=j.useRef(null);return A.jsxs("div",{className:"relative",children:[A.jsx("button",{onClick:()=>o.current?.click(),className:"w-8 h-5.5 rounded border-2 border-neutral-200 cursor-pointer",style:{backgroundColor:t},title:t}),A.jsx("input",{ref:o,type:"color",value:t,onChange:a=>r(a.target.value),className:"absolute opacity-0 w-0 h-0 pointer-events-none"})]})},jo=({onClick:t})=>A.jsx("button",{onClick:t,className:"w-6 h-6 flex items-center justify-center text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-sm select-none shrink-0",title:"Reset to default",children:"↺"}),oO=({name:t,type:r})=>{const{showStats:o}=j.useContext(wl);return A.jsxs("div",{className:" min-w-40 flex flex-col gap-0.5 items-end",children:[A.jsx("span",{className:"font-mono text-xs text-neutral-900",children:t.replace("u_","").replaceAll("_"," ").replace(/\b\w/g,a=>a.toUpperCase())}),o&&A.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:r})]})},iO=({field:t,initialValue:r,handleUpdateUniformField:o})=>{const[a,s]=j.useState(r);j.useEffect(()=>{s(r),o(r)},[r]);const u=f=>{s(f),o(f)};return A.jsxs("div",{className:"flex items-center ",children:[A.jsx(Hn,{value:a,min:t.min,max:t.max,step:.01,onChange:u}),t.default!==void 0&&A.jsx(jo,{onClick:()=>u(t.default)})]})},aO=({handleUpdateUniformField:t})=>{const[r,o]=j.useState(!1),[a,s]=j.useState(0);j.useEffect(()=>{if(!r)return;const f=Date.now()-a*1e3;let h;const p=()=>{const m=(Date.now()-f)/1e3;s(m),t(m),h=requestAnimationFrame(p)};return h=requestAnimationFrame(p),()=>cancelAnimationFrame(h)},[r]);const u=()=>{o(!1),s(0),t(0)};return A.jsxs("div",{className:"flex items-center ",children:[A.jsx("button",{onClick:()=>o(f=>!f),className:"text-xs font-mono text-neutral-500 bg-neutral-100 hover:bg-neutral-200 rounded-sm w-6 h-6 flex items-center justify-center select-none",title:r?"Pause":"Play",children:r?"⏸":"▶"}),A.jsxs("span",{className:"font-mono text-xs text-neutral-500 px-2 w-16 text-right tabular-nums",children:[a.toFixed(2),"s"]}),A.jsx(jo,{onClick:u})]})},lO=({field:t,initialValue:r,handleUpdateUniformField:o})=>{const[a,s]=j.useState(r);j.useEffect(()=>{s(r),o(r)},[r]);const u=(h,p)=>{const m=[...a];m[h]=p,s(m),o(m)},f=h=>{s(h),o(h)};return A.jsxs("div",{className:"flex items-center ",children:[A.jsx("div",{className:"flex gap-2 flex-wrap flex-col",children:["x","y"].map((h,p)=>A.jsx(Hn,{label:h,value:a[p],onChange:m=>u(p,m)},h))}),t.default!==void 0&&A.jsx(jo,{onClick:()=>f(t.default)})]})},sO=({field:t,initialValue:r,handleUpdateUniformField:o})=>{const[a,s]=j.useState(r);j.useEffect(()=>{s(r),o(r)},[r]);const u=(h,p)=>{const m=[...a];m[h]=p,s(m),o(m)},f=h=>{s(h),o(h)};return A.jsxs("div",{className:"flex items-center ",children:[A.jsx("div",{className:"flex flex-col gap-2",children:["x","y","z"].map((h,p)=>A.jsx(Hn,{label:h,value:a[p],onChange:m=>u(p,m)},h))}),t.default!==void 0&&A.jsx(jo,{onClick:()=>f(t.default)})]})},uO=({field:t,initialValue:r,handleUpdateUniformField:o})=>{const[a,s]=j.useState(r);j.useEffect(()=>{s(r)},[r]);const u=f=>{s(f),o(f)};return A.jsxs("div",{className:"flex items-center ",children:[A.jsx(V0,{color:DE(a),onChange:f=>u(OE(f))}),t.default!==void 0&&A.jsx(jo,{onClick:()=>u(t.default)})]})},cO=({field:t,initialValue:r,handleUpdateUniformField:o})=>{const[a,s]=j.useState(r);j.useEffect(()=>{s(r),o(r)},[r]);const u=(h,p)=>{const m=[...a];m[h]=p,s(m),o(m)},f=h=>{s(h),o(h)};return A.jsxs("div",{className:"flex items-center gap-2 px-2",children:[A.jsx("div",{className:"flex flex-col gap-2",children:["x","y","z","w"].map((h,p)=>A.jsx(Hn,{label:h,value:a[p],onChange:m=>u(p,m)},h))}),t.default!==void 0&&A.jsx(jo,{onClick:()=>f(t.default)})]})},fO=({field:t,initialValue:r,handleUpdateUniformField:o})=>{const[a,s]=j.useState(r);j.useEffect(()=>{s(r)},[r]);const[u,f,h,p]=a,m=y=>{s(y),o(y)};return A.jsxs("div",{className:"flex items-center ",children:[A.jsx(V0,{color:DE([u,f,h]),onChange:y=>{const[g,x,_]=OE(y);m([g,x,_,p])}}),A.jsx(Hn,{label:"a",value:p,min:0,max:1,step:.01,onChange:y=>m([u,f,h,y])}),t.default!==void 0&&A.jsx(jo,{onClick:()=>m(t.default)})]})},dO=({handleUpdateUniformField:t})=>{const{mousePosition:r}=j.useContext(wl),[o,a]=j.useState([0,0]);return j.useEffect(()=>{let s;const u=()=>{const f=[r.current[0],r.current[1]];a(f),t(f),s=requestAnimationFrame(u)};return s=requestAnimationFrame(u),()=>cancelAnimationFrame(s)},[t]),A.jsx("div",{className:"flex items-center ",children:A.jsx("div",{className:"flex gap-2 flex-col",children:["x","y"].map((s,u)=>A.jsxs("div",{className:"flex items-center w-20 relative",children:[A.jsx("span",{className:"absolute left-1 z-10 bg-neutral-200 h-4 w-4 grid place-items-center pointer-events-none rounded-sm",children:A.jsx("p",{className:"text-[11px] font-mono w-3 text-neutral-500 leading-0 -translate-y-0.5 translate-x-0.5",children:s})}),A.jsx("span",{className:"text-xs font-mono text-neutral-500 pl-5 pointer-events-none bg-neutral-100 rounded-sm w-full h-6 flex items-center justify-end px-1 tabular-nums",children:o[u].toFixed(3)})]},s))})})},hO=({width:t,height:r,handleUpdateUniformField:o})=>{const a=j.useRef(o);return a.current=o,j.useEffect(()=>{a.current([t,r])},[t,r]),A.jsx("div",{className:"flex items-center ",children:A.jsx("div",{className:"flex gap-2 flex-col",children:["w","h"].map((s,u)=>A.jsxs("div",{className:"flex items-center w-20 relative",children:[A.jsx("span",{className:"absolute left-1 z-10 bg-neutral-200 h-4 w-4 grid place-items-center pointer-events-none rounded-sm",children:A.jsx("p",{className:"text-[11px] font-mono w-3 text-neutral-500 leading-0 -translate-y-0.5 translate-x-0.5",children:s})}),A.jsx("span",{className:"text-xs font-mono text-neutral-500 pl-5 pointer-events-none bg-neutral-100 rounded-sm w-full h-6 flex items-center justify-end px-1 tabular-nums",children:u===0?t:r})]},s))})})},mO=({value:t,handleUpdateUniformField:r})=>{const[o,a]=j.useState(!1),s=t?.src instanceof HTMLVideoElement?t.src:null,u=typeof t?.src=="string"?t.src:s?.src??null,f=s!==null,[h,p]=j.useState(u),[m,y]=j.useState(f),[g,x]=j.useState(u?u.split("/").pop()??null:null),[_,b]=j.useState(()=>s&&s.readyState>=1?[s.videoWidth,s.videoHeight]:null);j.useEffect(()=>{if(_===null){if(s){const w=()=>b([s.videoWidth,s.videoHeight]);s.readyState>=1?w():s.addEventListener("loadedmetadata",w,{once:!0})}else if(u&&!f){const w=new Image;w.onload=()=>b([w.naturalWidth,w.naturalHeight]),w.src=u}}},[]);const E=j.useRef(null),C=w=>{if(!w)return;const D=URL.createObjectURL(w),S=w.type.startsWith("video/");if(p(D),y(S),x(w.name),b(null),S){const N=document.createElement("video");N.autoplay=!0,N.muted=!0,N.loop=!0,N.playsInline=!0,N.onloadedmetadata=()=>b([N.videoWidth,N.videoHeight]),N.src=D,N.play(),r({type:"texture",src:N})}else{const N=new Image;N.onload=()=>b([N.naturalWidth,N.naturalHeight]),N.src=D,r({type:"texture",src:D})}};return j.useEffect(()=>{if(!o)return;const w=D=>{if(D.clipboardData){for(const S of D.clipboardData.items)if(S.type.startsWith("image/")||S.type.startsWith("video/")){C(S.getAsFile());break}}};return window.addEventListener("paste",w),()=>window.removeEventListener("paste",w)},[o]),A.jsx("div",{className:"flex items-center ",children:A.jsxs("div",{className:"flex flex-col items-start gap-2",children:[A.jsx("div",{tabIndex:0,onFocus:()=>a(!0),onBlur:()=>a(!1),className:`w-32 h-32 rounded overflow-hidden flex flex-col items-center justify-center cursor-pointer select-none transition border-4 text-neutral-500 text-xs font-mono p-2 ${o?"bg-neutral-50 border-neutral-300":"bg-neutral-100 border-neutral-50"}`,children:h?m?A.jsx("video",{src:h,className:"w-full h-full object-contain",autoPlay:!0,muted:!0,loop:!0,playsInline:!0}):A.jsx("img",{src:h,className:"w-full h-full object-contain"}):o?"cmd+V":A.jsxs(A.Fragment,{children:[A.jsx("p",{children:"Paste"}),A.jsx("p",{children:"Here"})]})}),A.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[A.jsx("button",{className:"button-base",onClick:()=>E.current?.click(),children:h?"Replace":"Upload"}),g&&A.jsx("span",{className:"text-[10px] text-neutral-400 font-mono truncate max-w-32",title:g,children:g}),_&&A.jsxs("span",{className:"text-[10px] text-neutral-400 font-mono",children:[_[0],"×",_[1]]})]}),A.jsx("input",{ref:E,type:"file",accept:"image/*,video/*",className:"hidden",onChange:w=>C(w.target.files?.[0]??null)})]})})},pv=[{position:0,color:"#000000"},{position:1,color:"#ffffff"}],pO=({value:t,handleUpdateUniformField:r})=>{const[o,a]=j.useState(t?.stops??pv),s=j.useRef(null),u=j.useRef(null);j.useEffect(()=>{a(t?.stops??pv)},[t]),j.useEffect(()=>{const g=s.current;if(!g)return;const x=g.getContext("2d");if(x){for(let _=0;_<g.width;_++)x.fillStyle=Gb(o,_/(g.width-1)),x.fillRect(_,0,1,g.height);r({type:"gradient",stops:o})}},[o]);const f=g=>x=>{x.preventDefault();const _=u.current;if(!_)return;const b=C=>{const w=_.getBoundingClientRect(),S=Math.max(0,Math.min(C.clientX-w.left,w.width))/w.width;a(N=>N.map((O,z)=>z===g?{...O,position:S}:O))},E=()=>{window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",E)};window.addEventListener("mousemove",b),window.addEventListener("mouseup",E)},h=()=>a(g=>[...g,{position:1,color:"#ffffff"}]),p=g=>{o.length<=1||a(x=>x.filter((_,b)=>b!==g))},m=(g,x)=>a(_=>_.map((b,E)=>E===g?{...b,position:x}:b)),y=(g,x)=>a(_=>_.map((b,E)=>E===g?{...b,color:x}:b));return A.jsxs("div",{className:"flex flex-col gap-3 p-2",children:[A.jsxs("div",{ref:u,className:"relative w-32 h-4 nodrag nopan",children:[A.jsx("canvas",{ref:s,width:128,height:16,className:"w-32 h-4 rounded-sm border-2 border-neutral-200"}),o.map((g,x)=>A.jsx("button",{"aria-label":`gradient stop ${x}`,className:"absolute w-4 h-4 -translate-x-1/2 -bottom-2 rounded-sm border-2 border-neutral-200 cursor-ew-resize",style:{left:`${g.position*100}%`,backgroundColor:g.color},onMouseDown:f(x)},x))]}),A.jsxs("div",{className:"flex items-center justify-between w-32",children:[A.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:"STOPS"}),A.jsx("button",{onClick:h,className:"font-mono text-[10px] text-neutral-500 hover:text-neutral-800 leading-none",children:"ADD +"})]}),A.jsx("div",{className:"flex flex-col gap-1.5",children:o.map((g,x)=>A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx(Hn,{value:g.position,min:0,max:1,step:.01,onChange:_=>m(x,_)}),A.jsx(V0,{color:g.color,onChange:_=>y(x,_)}),o.length>1&&A.jsx("button",{onClick:()=>p(x),className:"text-xs text-neutral-400 hover:text-neutral-700 leading-none px-1","aria-label":`remove stop ${x}`,children:"×"})]},x))})]})};function gO(t){switch(t.type){case"float":return t.special==="time"?"float time":"float";case"vec2":return t.special==="mouse"?"vec2 mouse":t.special==="resolution"?"vec2 resolution":"vec2";case"vec3":return t.color?"vec3 color":"vec3";case"vec4":return t.color?"vec4 color":"vec4";case"sampler2D":return t.source==="gradient"?"sampler2D gradient":"sampler2D texture"}}const zE=({shader:t,savedUniforms:r,handleUpdateUniform:o})=>{const a=j.useMemo(()=>Ui(t),[t.source]);return a.filter(s=>!(s.type==="sampler2D"&&s.source==="input")).length===0?A.jsx(A.Fragment,{}):A.jsx("div",{className:"rounded flex flex-col gap-1",children:a.map(s=>{const u=`${s.name}-${s.type}`,f=g=>o(s.name,g),h=g=>{o(s.name,g)},p=r[s.name],m=Xb(s);let y=null;switch(s.type){case"float":y=s.special==="time"?A.jsx(aO,{field:s,handleUpdateUniformField:f}):A.jsx(iO,{field:s,initialValue:p??m,handleUpdateUniformField:f});break;case"vec2":y=s.special==="mouse"?A.jsx(dO,{field:s,handleUpdateUniformField:f}):s.special==="resolution"?A.jsx(hO,{field:s,width:t.resolution.width,height:t.resolution.height,handleUpdateUniformField:f}):A.jsx(lO,{field:s,initialValue:p??m,handleUpdateUniformField:f});break;case"vec3":y=s.color?A.jsx(uO,{field:s,initialValue:p??m,handleUpdateUniformField:f}):A.jsx(sO,{field:s,initialValue:p??m,handleUpdateUniformField:f});break;case"vec4":y=s.color?A.jsx(fO,{field:s,initialValue:p??m,handleUpdateUniformField:f}):A.jsx(cO,{field:s,initialValue:p??m,handleUpdateUniformField:f});break;case"sampler2D":s.source==="texture"?y=A.jsx(mO,{field:s,value:p,handleUpdateUniformField:h}):s.source==="gradient"&&(y=A.jsx(pO,{field:s,value:p,handleUpdateUniformField:f}));break}return y===null?null:A.jsxs("div",{className:"flex items-center gap-4 rounded-sm mb-1",children:[A.jsx(oO,{name:s.name,type:gO(s)}),A.jsx("div",{className:"bg-neutral-100 p-1 rounded-md",children:y})]},u)})})},pc=({children:t,open:r,className:o,handleOpenChange:a})=>{const s=j.useRef(null),[u,f]=j.useState(r);return j.useEffect(()=>{f(!!r)},[r]),j.useEffect(()=>{s.current!==null&&(u?s.current.showModal():s.current.close()),a(u)},[u]),A.jsx("dialog",{ref:s,className:`top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-3xl h-5/6 border border-neutral-300 rounded-lg starting:opacity-0 opacity-100 transition-all transition-discrete ${u?"visible":"hidden"} ${o} nopan nodrag nowheel`,children:r&&t})},gv="pnpm i @sequenza/lib",BE=({uniforms:t,patch:r,open:o,onOpenChange:a})=>{const s=WN(t,r),[u,f]=j.useState("idle"),[h,p]=j.useState("idle"),m=()=>{navigator.clipboard.writeText(gv),f("done"),setTimeout(()=>f("idle"),1800)},y=()=>{navigator.clipboard.writeText(s),p("done"),setTimeout(()=>p("idle"),1800)};return A.jsxs(pc,{open:o,handleOpenChange:a,className:"flex flex-col gap-4 p-6 overflow-y-auto",children:[A.jsxs("div",{className:"flex items-center justify-between",children:[A.jsx("h2",{className:"text-sm font-medium text-neutral-800",children:"Integrate shader"}),A.jsx("button",{className:"button-base",onClick:()=>a(!1),children:"Close"})]}),A.jsxs("div",{className:"flex flex-col gap-1",children:[A.jsx("p",{className:"text-xs text-neutral-500",children:"Install"}),A.jsxs("div",{className:"flex items-center gap-2 bg-neutral-50 rounded py-4 px-4",children:[A.jsx("code",{className:"text-xs text-neutral-700 w-full select-all",children:gv}),A.jsx("button",{className:"button-base",onClick:m,children:u==="done"?"Copied!":"Copy"})]})]}),A.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-h-0",children:[A.jsx("p",{className:"text-xs text-neutral-500",children:"Component"}),A.jsxs("div",{className:"relative flex-1 min-h-0 bg-neutral-50 rounded",children:[A.jsx("button",{className:"absolute top-4 right-4 button-base",onClick:y,children:h==="done"?"Copied!":"Copy"}),A.jsx("textarea",{readOnly:!0,value:s,className:"w-full h-full resize-none bg-transparent text-xs text-neutral-700 font-mono p-4 pr-12 outline-none"})]})]})]})},yO=({open:t,onOpenChange:r,shader:o,patch:a,uniforms:s,savedUniforms:u,nodeId:f,handleFieldUpdate:h,handleUpdateNode:p})=>{const m=j.useRef(null),y=j.useRef(null),[g,x]=j.useState(!1),[_,b]=j.useState(null),E=(z,B)=>{const q=z.split(/\n(?=\d+: )/),I={};for(const ee of q){const U=ee.match(/^(\d+): ([\s\S]*)/);U&&(I[parseInt(U[1],10)]=U[2].trimEnd())}const ae=Math.max(1,B-3),V=B+3,$=[];for(let ee=ae;ee<=V;ee++)I[ee]!==void 0&&$.push(`${ee}: ${I[ee]}`);return $.join(`
|
|
896
|
+
`)},[C,w]=j.useState({w:1,h:1}),{width:D,height:S}=o.resolution;j.useEffect(()=>{const z=y.current;if(!z)return;const B=new ResizeObserver(([q])=>{const{width:I,height:ae}=q.contentRect;w({w:I,h:ae})});return B.observe(z),()=>B.disconnect()},[]);const N=()=>{m.current?.toBlob(z=>{z&&navigator.clipboard.write([new ClipboardItem({"image/png":z})])})},O=()=>{const z=m.current?.toDataURL("image/png");if(!z)return;const B=document.createElement("a");B.href=z,B.download=`${o.name}.png`,B.click()};return A.jsxs(pc,{open:t,handleOpenChange:r,className:"flex flex-col w-full h-full",children:[A.jsxs("div",{className:"flex items-center justify-between px-6 py-4 shrink-0",children:[A.jsx("h2",{className:"text-sm font-medium text-neutral-800",children:o.name}),A.jsx("button",{className:"button-base",onClick:()=>r(!1),children:"Close"})]}),A.jsxs("div",{className:"flex gap-16 px-6 pb-6 flex-1 min-h-0 items-center",children:[A.jsx("div",{className:"flex flex-col gap-8",children:A.jsx("div",{className:"flex flex-col gap-2",children:A.jsx(zE,{shader:o,savedUniforms:u,handleUpdateUniform:h})})}),A.jsxs("div",{className:"h-full w-full flex flex-col gap-4 ",children:[A.jsx("div",{ref:y,className:"flex bg-neutral-50 rounded w-4/5 items-center justify-center h-full",children:A.jsx(qb,{ref:m,animate:!0,width:D,height:S,patch:a,uniforms:s,className:D/S>C.w/C.h?"w-full":"h-full",onError:z=>b(z)})}),A.jsxs("div",{className:"flex flex-col gap-2 ",children:[A.jsxs("div",{className:"flex gap-1 bg-neutral-100 p-1 rounded-md w-min",children:[A.jsx(Hn,{label:"w",value:D,min:1,step:1,onChange:z=>p(f,B=>({...B,shader:{...B.shader,resolution:{width:z,height:S}}}))}),A.jsx(Hn,{label:"h",value:S,min:1,step:1,onChange:z=>p(f,B=>({...B,shader:{...B.shader,resolution:{width:D,height:z}}}))})]}),A.jsxs("div",{className:"flex gap-1 h-min w-min",children:[A.jsx("button",{className:"button-base",onClick:()=>x(!0),children:"Export"}),A.jsx(BE,{uniforms:s.current,patch:a,open:g,onOpenChange:x}),A.jsx("button",{className:"button-base",onClick:N,children:"Copy"}),A.jsx("button",{className:"button-base",onClick:O,children:"Save"})]})]})]})]}),_&&A.jsxs("div",{className:"flex flex-col gap-2 mx-6 mb-6 p-2 bg-white border-2 border-red-100 rounded-md",children:[A.jsx("p",{className:"text-white w-min text-nowrap bg-red-700 px-2 py-1 rounded text-xs",children:_.shaderName}),A.jsx("pre",{className:"text-xs text-red-600 font-mono whitespace-pre-wrap break-all",children:E(_.message,_.line)}),A.jsx("button",{className:"self-start text-xs px-2 py-1 rounded border border-red-200 bg-white text-red-600 hover:bg-red-50 cursor-pointer",onClick:()=>navigator.clipboard.writeText(_.message),children:"Copy error"})]})]})},xO=({data:t,selected:r,id:o})=>{const{patches:a,uniforms:s,handleUpdateUniforms:u,handleUpdateNode:f,showStats:h,setOpenExportNodeId:p,openPreviewNodeId:m,setOpenPreviewNodeId:y}=j.useContext(wl),[g,x]=j.useState(()=>s.current[t.shader.id]??{}),_=(V,$)=>{u(t.shader.id,ee=>({...ee,[V]:$}))},{width:b,height:E}=t.shader.resolution,[C,w]=j.useState(null),D=j.useRef(null),[S,N]=j.useState("idle"),[O,z]=j.useState("idle"),B=()=>{D.current?.toBlob(V=>{V&&navigator.clipboard.write([new ClipboardItem({"image/png":V})])}),N("done"),setTimeout(()=>N("idle"),1800)},q=()=>{const V=D.current?.toDataURL("image/png");if(!V)return;const $=document.createElement("a");$.href=V,$.download=`${t.shader.name}.png`,$.click()},I=j.useMemo(()=>Ui(t.shader).filter(V=>V.type==="sampler2D"&&V.source==="input").map(V=>V.name),[t.shader]),ae=(V,$)=>{const ee=V.split(/\n(?=\d+: )/),U={};for(const F of ee){const P=F.match(/^(\d+): ([\s\S]*)/);P&&(U[parseInt(P[1],10)]=P[2].trimEnd())}const X=Math.max(1,$-3),R=$+3,H=[];for(let F=X;F<=R;F++)U[F]!==void 0&&H.push(`${F}: ${U[F]}`);return H.join(`
|
|
897
|
+
`)};return!a||a[t.shader.id]===void 0?null:A.jsxs("div",{className:`
|
|
898
|
+
flex flex-col gap-4 bg-white rounded-lg p-6 relative transition-[outline] outline-neutral-200 duration-75
|
|
899
|
+
${r?"outline-4":"outline-0"}
|
|
900
|
+
`,children:[A.jsx("p",{className:"text-sm w-min py-1 px-2 bg-neutral-100 rounded-lg text-neutral-500 text-nowrap",children:t.shader.name}),h&&A.jsxs(A.Fragment,{children:[A.jsxs("p",{className:"text-xs text-neutral-500 absolute -top-6",children:["ID: ",t.shader.id]}),A.jsx("p",{className:"text-xs text-neutral-500 absolute -top-10",children:t.shader.name})]}),I.map((V,$)=>A.jsx(mv,{id:V,type:"target",position:xe.Top,count:{total:I.length,index:$}},V)),A.jsxs("div",{className:"flex gap-8",children:[A.jsx(zE,{shader:t.shader,savedUniforms:g,handleUpdateUniform:_}),A.jsxs("div",{className:"flex flex-col justify-center items-start gap-4 ",children:[A.jsxs("div",{className:"flex flex-col gap-2",children:[A.jsxs("div",{className:"relative max-w-96 group",children:[A.jsxs("div",{className:"flex absolute top-2 right-2 gap-2",children:[A.jsx("button",{className:"button-base group-hover:opacity-100 opacity-0",onClick:()=>{y(o),x(s.current[t.shader.id]??{})},children:"Expand"}),A.jsx(yO,{open:m===o,onOpenChange:V=>{x(s.current[t.shader.id]??{}),y(V?o:null)},shader:t.shader,patch:a[t.shader.id],uniforms:s,savedUniforms:g,nodeId:o,handleFieldUpdate:_,handleUpdateNode:f}),A.jsx("button",{className:`button-base ${t.paused?"opacity-100":"group-hover:opacity-100 opacity-0"}`,onClick:()=>{f(o,V=>({...V,paused:!V.paused}))},children:t.paused?"Resume":"Pause"})]}),A.jsx(qb,{ref:D,animate:!t.paused,width:b,height:E,patch:a[t.shader.id],uniforms:s,className:"w-full h-auto",style:{maxWidth:`${b/E*24}rem`},onError:V=>{w(V)}})]}),A.jsxs("div",{className:"flex gap-1 bg-neutral-100 rounded-md p-1 w-min",children:[A.jsx(Hn,{label:"w",value:b,min:1,step:1,onChange:V=>f(o,$=>({...$,shader:{...$.shader,resolution:{width:V,height:E}}}))}),A.jsx(Hn,{label:"h",value:E,min:1,step:1,onChange:V=>f(o,$=>({...$,shader:{...$.shader,resolution:{width:b,height:V}}}))})]})]}),A.jsxs("div",{className:"flex gap-1",children:[A.jsx("button",{className:"button-base",onClick:()=>p(o),children:"Export"}),A.jsx("button",{className:"button-base",onClick:B,children:S==="done"?"Copied!":"Copy"}),A.jsx("button",{className:"button-base",onClick:q,children:"Save"})]})]})]}),C&&A.jsxs("div",{className:"flex flex-col gap-2 p-2 bg-white border-2 border-red-100 rounded-md relative",children:[A.jsx("p",{className:"text-white w-min text-nowrap bg-red-700 px-2 py-1 rounded text-xs",children:C.shaderName}),A.jsx("pre",{className:"text-xs text-red-600 font-mono whitespace-pre-wrap break-all",children:ae(C.message,C.line)}),A.jsx("button",{className:"self-start text-xs px-2 py-1 rounded border border-red-200 bg-white text-red-600 hover:bg-red-50 cursor-pointer",onClick:()=>{navigator.clipboard.writeText(C.message),z("done"),setTimeout(()=>z("idle"),1800)},children:O==="done"?"Copied!":"Copy error"})]}),A.jsx(mv,{id:"out",type:"source",position:xe.Bottom})]})};function vO({sourceX:t,sourceY:r,targetX:o,targetY:a,sourcePosition:s,targetPosition:u,style:f={},markerEnd:h,id:p}){const[m,y,g]=cc({sourceX:t,sourceY:r,sourcePosition:s,targetX:o,targetY:a,targetPosition:u}),{shaders:x,handleInsertShader:_}=j.useContext(wl),[b,E]=j.useState(!1),C=()=>{console.log("d"),E(!0)};return A.jsxs(A.Fragment,{children:[A.jsx(Sl,{path:m,markerEnd:h,style:f}),A.jsx(D6,{children:A.jsxs("div",{className:"absolute -translate-1/2 origin-center pointer-events-auto",style:{transform:`translate(${y}px,${g}px)`},children:[A.jsx("button",{className:"w-6 h-6 bg-neutral-200 rounded-full active:bg-neutral-200 z-10 flex items-center justify-center",onClick:()=>C(),children:"+"}),A.jsx(pc,{open:b,handleOpenChange:w=>{E(w)},children:A.jsxs("div",{className:"w-full h-full flex flex-col p-4",children:[A.jsxs("div",{className:"w-full flex justify-between",children:[A.jsx("p",{children:"Add a Shader"}),A.jsx("button",{className:"button-base",onClick:()=>{E(!1)},children:"Close"})]}),A.jsx("div",{className:"w-full flex flex-col",children:x.map(w=>A.jsx("button",{className:"text-xs flex justify-start p-1 rounded-sm hover:bg-neutral-100 cursor-pointer text-neutral-500",onClick:()=>{_(w,p)},children:w.id},w.id))})]})})]})})]})}function bO({fromX:t,fromY:r,toX:o,toY:a,fromPosition:s,toPosition:u,toHandle:f}){const[h]=cc({sourceX:t,sourceY:r,sourcePosition:s,targetX:o,targetY:a,targetPosition:u}),p=f?"connect":"new",m=a-26,y=6,g=16,x=p.length*6+y*2;return A.jsxs("g",{children:[A.jsx("path",{fill:"none",stroke:"#b1b1b7",strokeWidth:1.5,d:h}),A.jsx("rect",{x:o-x/2,y:m-g/2,width:x,height:g,rx:4,fill:f?"#404040":"#e5e5e5",style:{pointerEvents:"none"}}),A.jsx("text",{x:o,y:m,textAnchor:"middle",dominantBaseline:"central",fontSize:10,fontFamily:"monospace",fill:f?"#ffffff":"#525252",style:{userSelect:"none",pointerEvents:"none"},children:p}),A.jsx("foreignObject",{x:o-8,y:a-8,width:16,height:16,style:{overflow:"visible"},children:A.jsx("div",{className:"w-4 h-4 rounded-full bg-neutral-400"})})]})}function fu(t,r,o){const a=new Map(t.map(u=>[u.id,u])),s=[o];for(;s.length>0;){const u=s.shift(),f=a.get(u);if(!f||f.type!=="shader")continue;const h=f,{width:p,height:m}=h.data.shader.resolution,y=T_(f,[...a.values()],r);for(const g of y){const x={...g,data:{...g.data,shader:{...g.data.shader,resolution:{width:p,height:m}}}};a.set(g.id,x),s.push(g.id)}}return[...a.values()]}const _O=({shaders:t,initialState:r,handleSave:o,className:a,initialShowStats:s,initialShaderPanelOpen:u,initialOpenPreviewNodeId:f,onEditorStateChange:h,onOpenPreviewNodeIdChange:p})=>{const[m,y]=j.useState(r?.edges??[]),[g,x]=j.useState(()=>{const oe=r?.nodes??[],fe=r?.edges??[],me=new Set(fe.map(Le=>Le.target)),Ce=oe.filter(Le=>!me.has(Le.id)).map(Le=>Le.id);let je=oe;for(const Le of Ce)je=fu(je,fe,Le);return je}),_=j.useCallback(oe=>x(fe=>nE(oe,fe)),[x]),b=j.useCallback(oe=>y(fe=>rE(oe,fe)),[y]),E=j.useCallback(oe=>{const fe=new Set,me=Ce=>fe.has(Ce)?!1:Ce===oe.source?!0:(fe.add(Ce),T_({id:Ce},g,m).some(je=>me(je.id)));return!me(oe.target)},[g,m]),C=j.useCallback(oe=>{const fe=Dh({...oe,type:"insert"},m),me=fu(g,fe,oe.source);y(fe),x(me)},[m,g]),{screenToFlowPosition:w}=hc(),[D,S]=j.useState(null),N=j.useCallback((oe,fe)=>{if(!fe.isValid&&fe.fromNode){const{clientX:me,clientY:Ce}="changedTouches"in oe?oe.changedTouches[0]:oe;S({position:w({x:me,y:Ce}),sourceId:fe.fromNode.id})}},[w]),O=j.useRef(r?.uniforms??{});j.useEffect(()=>{r?.uniforms&&(O.current=r.uniforms)},[r]),j.useEffect(()=>{x(oe=>oe.map(fe=>{if(fe.type==="shader"){const me=fe;for(const Ce of t)if(me.data.shader.name===Ce.name)return{...me,data:{...me.data,shader:{...me.data.shader,source:Ce.source}}};return me}return fe}))},[t]);const[z,B]=j.useState(null);j.useEffect(()=>{const oe=fe=>{(fe.metaKey||fe.ctrlKey)&&fe.key==="s"&&(fe.preventDefault(),o({nodes:g,edges:m,uniforms:O.current}),B(new Date))};return window.addEventListener("keydown",oe),()=>window.removeEventListener("keydown",oe)},[g,m]);const q=oe=>{const fe=`${Math.random()*1e5}`,me={...oe,id:fe};return O.current[fe]={},{id:fe,position:{x:0,y:0},data:{shader:me,uniforms:O,paused:!1},type:"shader"}},I=oe=>{x(fe=>[...fe,q(oe)])},ae=(oe,fe)=>{const me=m.find($e=>$e.id===fe);if(!me)return;const Ce=me.source,je=me.target,Le=g.find($e=>$e.id===Ce),tt=g.find($e=>$e.id===je),it=me.targetHandle;if(Le&&tt&&it){const $e=q(oe),Wt=Ui($e.data.shader);let at;for(const Nt of Wt)if(Nt.type==="sampler2D"&&Nt.source==="input"){at=Nt.name;break}if(at===void 0)return;const[Wr,cn,Sn]=k0({sourceX:Le.position.x,sourceY:Le.position.y,sourcePosition:xe.Bottom,targetX:tt.position.x,targetY:tt.position.y,targetPosition:xe.Top});$e.position.x=cn,$e.position.y=Sn,x(Nt=>[...Nt,$e]),y(Nt=>{const eo=Nt.filter(Ii=>Ii.id!==fe),hr={id:""+Math.random()*1e4,source:Le.id,target:$e.id,targetHandle:at,type:"insert"},Yi={id:""+Math.random()*1e4,source:$e.id,target:tt.id,targetHandle:it,type:"insert"};return eo.push(hr),eo.push(Yi),eo})}},[V,$]=j.useMemo(()=>{const oe={};for(const me of g)oe[me.id]=[];for(const me of m)oe[me.target].push({from:me.source,to:me.target,input:me.targetHandle??""});return[JSON.stringify(oe),oe]},[m,g]),[ee,U]=j.useMemo(()=>{const oe={};for(const fe of g)if(fe.type==="shader"){const me=fe;oe[me.id]=me.data.shader}return[JSON.stringify(oe),oe]},[g]),X=j.useMemo(()=>{const oe={};for(const[fe,me]of Object.entries(U)){oe[fe]={shaders:[me],connections:[]};const Ce=[fe];for(;Ce.length!==0;){const je=Ce.shift();for(const Le of $[je]){const tt=Le.from;Ce.push(tt);const it=U[tt];oe[fe].shaders.find($e=>$e.id===it.id)||oe[fe].shaders.push(it),oe[fe].connections.push(Le)}}}return oe},[ee,V]),R=j.useCallback((oe,fe)=>{O.current[oe]=fe(O.current[oe])},[]),H=j.useCallback((oe,fe)=>{x(me=>{const Ce=me.map(je=>{if(je.id===oe&&je.type==="shader"){const Le=je;return{...Le,data:fe(Le.data)}}return je});return fu(Ce,m,oe)})},[m]),F=j.useRef(0),P=j.useRef([0,0]);j.useEffect(()=>{const oe=setInterval(()=>{F.current=Date.now()},10),fe=me=>{P.current=[Math.min(1,me.clientX/window.innerWidth),Math.min(me.clientY/innerHeight,1)]};return window.addEventListener("mousemove",fe),()=>{clearInterval(oe),window.removeEventListener("mousemove",fe)}},[]);const te=j.useCallback((oe,fe,me)=>{const Ce=g.find(je=>je.id===fe);if(Ce){const je=q(oe);je.position=me;const Le=Ui(je.data.shader);let tt;for(const it of Le)if(it.type==="sampler2D"&&it.source==="input"){tt=it.name;break}if(tt!==void 0){const it={id:""+Math.random(),source:fe,target:je.id,targetHandle:tt,type:"insert"},$e=Dh(it,m),Wt=fu([...g,je],$e,Ce.id);console.log($e),console.log(Wt),y($e),x(Wt)}}},[g,m]),[M,k]=j.useState(""),[W,ne]=j.useState(""),[se,he]=j.useState(s??!1),[ce,ue]=j.useState(u??!0),[de,ge]=j.useState(null),[Se,be]=j.useState(f??null),Ee=oe=>{be(oe),p?.(oe)};return j.useEffect(()=>{h?.({showStats:se,shaderPanelOpen:ce})},[se,ce]),A.jsxs("div",{className:`w-full h-full ${a}`,children:[A.jsx(wl.Provider,{value:{currentTime:F,mousePosition:P,shaders:t,patches:X,showStats:se,openExportNodeId:de,setOpenExportNodeId:ge,openPreviewNodeId:Se,setOpenPreviewNodeId:Ee,uniforms:O,handleUpdateUniforms:R,handleUpdateNode:H,handleInsertShader:ae},children:A.jsxs(R6,{panOnScroll:!0,proOptions:{hideAttribution:!0},nodes:g,nodeTypes:{shader:xO},edges:m,edgeTypes:{insert:vO},onNodesChange:_,onEdgesChange:b,onConnect:C,onConnectEnd:N,connectionLineComponent:bO,isValidConnection:E,style:{background:"#F3F3F3"},fitView:!0,children:[A.jsx(G6,{style:{"--xy-controls-button-background-color-default":"transparent","--xy-controls-box-shadow-default":"none"}}),A.jsxs(Do,{position:"top-left",className:"flex flex-col gap-4",children:[A.jsx("button",{className:"button-base",onClick:()=>he(!se),children:se?"Hide Stats":"Show Stats"}),se&&A.jsxs(A.Fragment,{children:[A.jsx("div",{className:"flex flex-col gap-2",children:g.map(oe=>A.jsx("p",{className:"text-xs text-neutral-400",children:oe.id},oe.id))}),A.jsx("div",{className:"flex flex-col gap-2",children:m.map(oe=>A.jsxs("p",{className:"text-xs text-neutral-400",children:[oe.source," ",">"," ",oe.target," ",oe.targetHandle]},oe.id))})]})]}),t.length>0&&A.jsx(Do,{position:"bottom-right",children:A.jsxs("div",{className:"w-56 flex flex-col rounded-sm bg-white overflow-hidden",children:[A.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[A.jsx("p",{className:"text-sm",children:"Add Shader"}),A.jsx("button",{className:"button-base",onClick:()=>ue(!ce),children:ce?"Hide":"Show"})]}),ce&&A.jsxs("div",{className:"flex flex-col gap-1 px-2 pb-2",children:[A.jsx("input",{type:"text",value:M,onChange:oe=>k(oe.target.value),placeholder:"Search shaders...",className:"text-xs p-1 rounded-sm border border-neutral-200 outline-none mb-1"}),A.jsx("div",{className:"flex flex-col gap-1 pb-2 h-[50vh] overflow-y-auto",children:t.filter(oe=>oe.name.toLowerCase().includes(M.toLowerCase())).sort((oe,fe)=>oe.name.localeCompare(fe.name)).map(oe=>A.jsx("button",{className:"text-xs flex justify-start p-1 rounded-sm hover:bg-neutral-100 cursor-pointer text-neutral-500",onClick:()=>I(oe),children:oe.id.length>25?`${oe.id.slice(0,11)}...${oe.id.slice(-11)}`:oe.id},oe.id))})]})]})}),z&&A.jsx(Do,{position:"bottom-center",children:A.jsxs("p",{className:"text-xs text-neutral-400",children:["Last saved at ",z.toLocaleTimeString()]})})]})}),de!==null&&X[de]&&A.jsx(BE,{uniforms:O.current,patch:X[de],open:!0,onOpenChange:oe=>{oe||ge(null)}}),A.jsx(pc,{open:D!==null,handleOpenChange:oe=>{oe===!1&&S(null)},children:A.jsxs("div",{className:"w-full h-full flex flex-col p-4 gap-4",children:[A.jsxs("div",{className:"w-full flex justify-between",children:[A.jsx("p",{children:"Add a Shader"}),A.jsx("button",{className:"button-base",onClick:()=>{S(null)},children:"Close"})]}),A.jsxs("div",{className:"w-full flex flex-col h-full overflow-hidden gap-2",children:[A.jsx("input",{type:"text",value:W,onChange:oe=>ne(oe.target.value),placeholder:"Search shaders...",className:"text-xs p-1 rounded-sm border border-neutral-200 outline-none mb-1"}),A.jsx("div",{className:"h-full flex flex-col overflow-y-auto",children:t.filter(oe=>oe.name.toLowerCase().includes(W.toLowerCase())).map(oe=>A.jsx("button",{className:"text-xs flex justify-start p-1 rounded-sm hover:bg-neutral-100 cursor-pointer text-neutral-500",onClick:()=>{D&&te(oe,D.sourceId,D.position),S(null)},children:oe.id},oe.id))})]})]})})]})},EO=t=>A.jsx(CE,{children:A.jsx(_O,{...t})});function SO(){const[t,r]=j.useState({}),o=j.useRef({});j.useEffect(()=>{const u={};for(const[h,p]of Object.entries(l3))u[h]={id:h,source:p,name:h,resolution:{width:100,height:100}},o.current[h]={};console.log("[CONNECT]");const f=pu("http://localhost:3001");return f.on("shaders-found",h=>{const p={};for(const[m,y]of Object.entries(h))p[m]={id:m,source:y,name:m,resolution:{width:100,height:100}},o.current[m]={};r({...p,...u})}),()=>{console.log("[DISCONNECT]"),f.disconnect()}},[]);const a=j.useMemo(()=>{try{const u=JSON.parse(localStorage.getItem("sequenza-nodes")??"[]");let f=JSON.parse(localStorage.getItem("sequenza-edges")??"[]");const h=JSON.parse(localStorage.getItem("sequenza-uniforms")??"{}");for(const m of u)if(m.type==="shader"){const y=m,g=t[y.data.shader.name];if(g&&y.data.shader.source!==g?.source){const x={...g,id:y.data.shader.id};y.data.shader=x}}const p=new Set(u.map(m=>m.id));for(const m of Object.keys(h))p.has(m)||delete h[m];for(const m of u){if(m.type!=="shader")continue;const y=m,g=h[y.id];if(!g)continue;const x=Ui(y.data.shader),_={};for(const b of x){if(b.type==="sampler2D"&&b.source==="input")continue;const E=g[b.name];if(E!==void 0&&KN(E,b))_[b.name]=E;else{const C=Xb(b);C!==void 0&&(_[b.name]=C)}}h[y.id]=_}if(f=f.filter(m=>{const y=u.find(E=>E.id===m.source),g=u.find(E=>E.id===m.target),x=m.targetHandle;if(!g||g&&g.type!=="shader")return!1;const b=Ui(g.data.shader);return!(!y||x===null||x===void 0||b.find(E=>E.name===x&&E.type==="sampler2D")===void 0)}),u!==null&&f!==null&&h!==null)return{nodes:u,edges:f,uniforms:h}}catch(u){console.error(u)}},[t]),s=Object.keys(t).length>0;return A.jsx("main",{className:"",children:A.jsx("div",{className:"w-full min-h-screen h-screen ",children:s&&A.jsx(EO,{shaders:[...Object.values(t)],initialState:a,initialShowStats:localStorage.getItem("sequenza-show-stats")==="true",initialShaderPanelOpen:localStorage.getItem("sequenza-shader-panel-open")!=="false",initialOpenPreviewNodeId:localStorage.getItem("sequenza-open-preview-node")||null,onEditorStateChange:({showStats:u,shaderPanelOpen:f})=>{localStorage.setItem("sequenza-show-stats",String(u)),localStorage.setItem("sequenza-shader-panel-open",String(f))},onOpenPreviewNodeIdChange:u=>{u?localStorage.setItem("sequenza-open-preview-node",u):localStorage.removeItem("sequenza-open-preview-node")},handleSave:({nodes:u,edges:f,uniforms:h})=>{localStorage.setItem("sequenza-nodes",JSON.stringify(u)),localStorage.setItem("sequenza-edges",JSON.stringify(f)),localStorage.setItem("sequenza-uniforms",JSON.stringify(h))}})})})}ZS.createRoot(document.getElementById("root")).render(A.jsx(j.StrictMode,{children:A.jsx(SO,{})}));
|