@cyca/react-timeline-editor 0.2.4-alpha.2 → 0.2.4-alpha.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.
@@ -1,13 +1,13 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react"),A=require("./index-HslTC57T.cjs"),fr=require("react-dom");function dr(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const b=dr(L);var Nt={exports:{}},At={};var ln;function hr(){if(ln)return At;ln=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var c in s)c!=="key"&&(o[c]=s[c])}else o=s;return s=o.ref,{$$typeof:n,type:r,key:i,ref:s!==void 0?s:null,props:o}}return At.Fragment=e,At.jsx=t,At.jsxs=t,At}var Ct={};var un;function mr(){return un||(un=1,process.env.NODE_ENV!=="production"&&(function(){function n(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===H?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case y:return"Fragment";case h:return"Profiler";case _:return"StrictMode";case E:return"Suspense";case C:return"SuspenseList";case j:return"Activity"}if(typeof d=="object")switch(typeof d.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),d.$$typeof){case S:return"Portal";case v:return d.displayName||"Context";case p:return(d._context.displayName||"Context")+".Consumer";case R:var x=d.render;return d=d.displayName,d||(d=x.displayName||x.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case z:return x=d.displayName||null,x!==null?x:n(d.type)||"Memo";case D:x=d._payload,d=d._init;try{return n(d(x))}catch{}}return null}function e(d){return""+d}function t(d){try{e(d);var x=!1}catch{x=!0}if(x){x=console;var M=x.error,$=typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object";return M.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",$),e(d)}}function r(d){if(d===y)return"<>";if(typeof d=="object"&&d!==null&&d.$$typeof===D)return"<...>";try{var x=n(d);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function s(){var d=te.A;return d===null?null:d.getOwner()}function o(){return Error("react-stack-top-frame")}function i(d){if(B.call(d,"key")){var x=Object.getOwnPropertyDescriptor(d,"key").get;if(x&&x.isReactWarning)return!1}return d.key!==void 0}function c(d,x){function M(){P||(P=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",x))}M.isReactWarning=!0,Object.defineProperty(d,"key",{get:M,configurable:!0})}function a(){var d=n(this.type);return I[d]||(I[d]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),d=this.props.ref,d!==void 0?d:null}function u(d,x,M,$,fe,k){var U=M.ref;return d={$$typeof:w,type:d,key:x,props:M,_owner:$},(U!==void 0?U:null)!==null?Object.defineProperty(d,"ref",{enumerable:!1,get:a}):Object.defineProperty(d,"ref",{enumerable:!1,value:null}),d._store={},Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(d,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(d,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:fe}),Object.defineProperty(d,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:k}),Object.freeze&&(Object.freeze(d.props),Object.freeze(d)),d}function l(d,x,M,$,fe,k){var U=x.children;if(U!==void 0)if($)if(re(U)){for($=0;$<U.length;$++)m(U[$]);Object.freeze&&Object.freeze(U)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(U);if(B.call(x,"key")){U=n(d);var N=Object.keys(x).filter(function(O){return O!=="key"});$=0<N.length?"{key: someKey, "+N.join(": ..., ")+": ...}":"{key: someKey}",Q[U+$]||(N=0<N.length?"{"+N.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),D=require("./index-6kJWhJ-8.cjs"),gr=require("react-dom");function vr(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const g=vr(O);var Ft={exports:{}},Mt={};var mn;function br(){if(mn)return Mt;mn=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var a in s)a!=="key"&&(o[a]=s[a])}else o=s;return s=o.ref,{$$typeof:n,type:r,key:i,ref:s!==void 0?s:null,props:o}}return Mt.Fragment=e,Mt.jsx=t,Mt.jsxs=t,Mt}var It={};var pn;function Sr(){return pn||(pn=1,process.env.NODE_ENV!=="production"&&(function(){function n(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===W?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case T:return"Fragment";case b:return"Profiler";case w:return"StrictMode";case y:return"Suspense";case P:return"SuspenseList";case E:return"Activity"}if(typeof d=="object")switch(typeof d.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),d.$$typeof){case _:return"Portal";case v:return d.displayName||"Context";case h:return(d._context.displayName||"Context")+".Consumer";case R:var A=d.render;return d=d.displayName,d||(d=A.displayName||A.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case M:return A=d.displayName||null,A!==null?A:n(d.type)||"Memo";case x:A=d._payload,d=d._init;try{return n(d(A))}catch{}}return null}function e(d){return""+d}function t(d){try{e(d);var A=!1}catch{A=!0}if(A){A=console;var L=A.error,F=typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object";return L.call(A,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",F),e(d)}}function r(d){if(d===T)return"<>";if(typeof d=="object"&&d!==null&&d.$$typeof===x)return"<...>";try{var A=n(d);return A?"<"+A+">":"<...>"}catch{return"<...>"}}function s(){var d=J.A;return d===null?null:d.getOwner()}function o(){return Error("react-stack-top-frame")}function i(d){if(Z.call(d,"key")){var A=Object.getOwnPropertyDescriptor(d,"key").get;if(A&&A.isReactWarning)return!1}return d.key!==void 0}function a(d,A){function L(){k||(k=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",A))}L.isReactWarning=!0,Object.defineProperty(d,"key",{get:L,configurable:!0})}function c(){var d=n(this.type);return Y[d]||(Y[d]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),d=this.props.ref,d!==void 0?d:null}function u(d,A,L,F,me,ge){var X=L.ref;return d={$$typeof:S,type:d,key:A,props:L,_owner:F},(X!==void 0?X:null)!==null?Object.defineProperty(d,"ref",{enumerable:!1,get:c}):Object.defineProperty(d,"ref",{enumerable:!1,value:null}),d._store={},Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(d,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(d,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:me}),Object.defineProperty(d,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ge}),Object.freeze&&(Object.freeze(d.props),Object.freeze(d)),d}function l(d,A,L,F,me,ge){var X=A.children;if(X!==void 0)if(F)if(K(X)){for(F=0;F<X.length;F++)m(X[F]);Object.freeze&&Object.freeze(X)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(X);if(Z.call(A,"key")){X=n(d);var te=Object.keys(A).filter(function(se){return se!=="key"});F=0<te.length?"{key: someKey, "+te.join(": ..., ")+": ...}":"{key: someKey}",I[X+F]||(te=0<te.length?"{"+te.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,$,U,N,U),Q[U+$]=!0)}if(U=null,M!==void 0&&(t(M),U=""+M),i(x)&&(t(x.key),U=""+x.key),"key"in x){M={};for(var W in x)W!=="key"&&(M[W]=x[W])}else M=x;return U&&c(M,typeof d=="function"?d.displayName||d.name||"Unknown":d),u(d,U,M,s(),fe,k)}function m(d){f(d)?d._store&&(d._store.validated=1):typeof d=="object"&&d!==null&&d.$$typeof===D&&(d._payload.status==="fulfilled"?f(d._payload.value)&&d._payload.value._store&&(d._payload.value._store.validated=1):d._store&&(d._store.validated=1))}function f(d){return typeof d=="object"&&d!==null&&d.$$typeof===w}var g=L,w=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),v=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),H=Symbol.for("react.client.reference"),te=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=Object.prototype.hasOwnProperty,re=Array.isArray,q=console.createTask?console.createTask:function(){return null};g={react_stack_bottom_frame:function(d){return d()}};var P,I={},J=g.react_stack_bottom_frame.bind(g,o)(),Z=q(r(o)),Q={};Ct.Fragment=y,Ct.jsx=function(d,x,M){var $=1e4>te.recentlyCreatedOwnerStacks++;return l(d,x,M,!1,$?Error("react-stack-top-frame"):J,$?q(r(d)):Z)},Ct.jsxs=function(d,x,M){var $=1e4>te.recentlyCreatedOwnerStacks++;return l(d,x,M,!0,$?Error("react-stack-top-frame"):J,$?q(r(d)):Z)}})()),Ct}var fn;function pr(){return fn||(fn=1,process.env.NODE_ENV==="production"?Nt.exports=hr():Nt.exports=mr()),Nt.exports}var T=pr();const qt={trace:0,debug:1,info:2,warn:3,error:4,silent:5},gr=["trace","debug","info","warn","error"];var vr=class Wn{s;ls=new Map;lvl;def;n;r;c=console;e;trace;debug;info;warn;error;constructor(e,t,r,s){this.s=e,this.e=t,this.n=r,this.r=s,this.bindMethods()}noop=()=>{};bindMethods(){gr.forEach(e=>{const t=this.e.bind(this.c,e,this.n);Object.defineProperty(this,e,{get:()=>qt[e]>=qt[this.currentLevel()]?t:this.noop,configurable:!0})})}storageKey(){return this.n?`loglevel:${String(this.n)}`:"loglevel"}currentLevel(){if(this.lvl)return this.lvl;const e=this.s.get(this.storageKey());return e&&e in qt?(this.lvl=e,this.lvl):this.def?this.def:this.r?this.r.currentLevel():"trace"}setLevel(e){return this.lvl=e,this.s.set(this.storageKey(),e),this}setDefaultLevel(e){return this.s.get(this.storageKey())||(this.def=e),this}resetLevel(){return this.lvl=void 0,this.s.del(this.storageKey()),this}getLogger(e){if(!e)throw new Error("Logger name required");if(!this.ls.has(e)){const t=new Wn(this.s,this.e,e,this.r||this);this.ls.set(e,zn(t))}return this.ls.get(e)}getLoggers(){const e={};return this.ls.forEach((t,r)=>{e[String(r)]=t}),e}use(e){this.c=e,this.bindMethods()}};function zn(n){return new Proxy(n,{get(e,t,r){if(t in e)return Reflect.get(e,t,r);const s=e.c[t];return typeof s=="function"?s.bind(e.c):s}})}var br=class{get(n){return localStorage.getItem(n)}set(n,e){localStorage.setItem(n,e)}del(n){localStorage.removeItem(n)}};const Sr={trace:"#95bdb7",debug:"#ad95b8",info:"#b6bd73",warn:"#88a1bb",error:"#bf6c69"},dn={info:"⚡️",success:"✔",warn:"▲",error:"✖",log:"●",trace:"◔",debug:"◌"},_r={bind(n,e,t){const r=t?`${dn[e]} ${String(t)}:`:`${dn[e]}`;return(n[e]||n.log).bind(n,`%c${r}%c`,`color: ${Sr[e]}; font-weight: bold;`,"color: inherit")}},Qe=zn(new vr(new br,_r));function wr(n){let{editorData:e=[],effects:t={},scale:r=A.DEFAULT_SCALE,scaleSplitCount:s=A.DEFAULT_SCALE_SPLIT_COUNT,scaleWidth:o=A.DEFAULT_SCALE_WIDTH,startLeft:i=A.DEFAULT_START_LEFT,minScaleCount:c,maxScaleCount:a=1/0,rowHeight:u=A.DEFAULT_ROW_HEIGHT}=n;r<=0&&(Qe.error("Error: scale must be greater than 0!"),r=A.DEFAULT_SCALE),s<=0&&(Qe.warn("Warning: scaleSplitCount cannot be less than 1!"),s=1),o<=0&&(Qe.warn("Warning: scaleWidth must be greater than 0!"),o=A.DEFAULT_SCALE_WIDTH),i<0&&(Qe.warn("Warning: startLeft cannot be less than 0!"),i=0),c&&typeof c=="number"&&(c<1&&(Qe.warn("Warning: minScaleCount must be greater than 1!"),c=A.MIN_SCALE_COUNT),c=parseInt(c+""),a<c&&(Qe.warn("Warning: maxScaleCount cannot be less than minScaleCount!"),a=c)),a=a===1/0?1/0:parseInt(a+""),u<=0&&(Qe.warn("Warning: rowHeight must be greater than 0!"),u=A.DEFAULT_ROW_HEIGHT);const l={...n};return delete l.style,{...l,editorData:e,effects:t,scale:r,scaleSplitCount:s,scaleWidth:o,startLeft:i,minScaleCount:c,maxScaleCount:a,rowHeight:u}}function Er(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.map(function(r){return r.split(" ").map(function(s){return s?""+n+s:""}).join(" ")}).join(" ")}function ge(...n){return Er(`${A.PREFIX}-`,...n)}var It={exports:{}},Kt={};var hn;function yr(){if(hn)return Kt;hn=1;var n=L.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Kt.c=function(e){return n.H.useMemoCache(e)},Kt}var Jt={};var mn;function Tr(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){var n=L.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;Jt.c=function(e){var t=n.H;return t===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
6
+ <%s key={someKey} {...props} />`,F,X,te,X),I[X+F]=!0)}if(X=null,L!==void 0&&(t(L),X=""+L),i(A)&&(t(A.key),X=""+A.key),"key"in A){L={};for(var U in A)U!=="key"&&(L[U]=A[U])}else L=A;return X&&a(L,typeof d=="function"?d.displayName||d.name||"Unknown":d),u(d,X,L,s(),me,ge)}function m(d){f(d)?d._store&&(d._store.validated=1):typeof d=="object"&&d!==null&&d.$$typeof===x&&(d._payload.status==="fulfilled"?f(d._payload.value)&&d._payload.value._store&&(d._payload.value._store.validated=1):d._store&&(d._store.validated=1))}function f(d){return typeof d=="object"&&d!==null&&d.$$typeof===S}var p=O,S=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),v=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),W=Symbol.for("react.client.reference"),J=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=Object.prototype.hasOwnProperty,K=Array.isArray,ie=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(d){return d()}};var k,Y={},Q=p.react_stack_bottom_frame.bind(p,o)(),j=ie(r(o)),I={};It.Fragment=T,It.jsx=function(d,A,L){var F=1e4>J.recentlyCreatedOwnerStacks++;return l(d,A,L,!1,F?Error("react-stack-top-frame"):Q,F?ie(r(d)):j)},It.jsxs=function(d,A,L){var F=1e4>J.recentlyCreatedOwnerStacks++;return l(d,A,L,!0,F?Error("react-stack-top-frame"):Q,F?ie(r(d)):j)}})()),It}var gn;function _r(){return gn||(gn=1,process.env.NODE_ENV==="production"?Ft.exports=br():Ft.exports=Sr()),Ft.exports}var C=_r();const en={trace:0,debug:1,info:2,warn:3,error:4,silent:5},wr=["trace","debug","info","warn","error"];var Er=class Vn{s;ls=new Map;lvl;def;n;r;c=console;e;trace;debug;info;warn;error;constructor(e,t,r,s){this.s=e,this.e=t,this.n=r,this.r=s,this.bindMethods()}noop=()=>{};bindMethods(){wr.forEach(e=>{const t=this.e.bind(this.c,e,this.n);Object.defineProperty(this,e,{get:()=>en[e]>=en[this.currentLevel()]?t:this.noop,configurable:!0})})}storageKey(){return this.n?`loglevel:${String(this.n)}`:"loglevel"}currentLevel(){if(this.lvl)return this.lvl;const e=this.s.get(this.storageKey());return e&&e in en?(this.lvl=e,this.lvl):this.def?this.def:this.r?this.r.currentLevel():"trace"}setLevel(e){return this.lvl=e,this.s.set(this.storageKey(),e),this}setDefaultLevel(e){return this.s.get(this.storageKey())||(this.def=e),this}resetLevel(){return this.lvl=void 0,this.s.del(this.storageKey()),this}getLogger(e){if(!e)throw new Error("Logger name required");if(!this.ls.has(e)){const t=new Vn(this.s,this.e,e,this.r||this);this.ls.set(e,$n(t))}return this.ls.get(e)}getLoggers(){const e={};return this.ls.forEach((t,r)=>{e[String(r)]=t}),e}use(e){this.c=e,this.bindMethods()}};function $n(n){return new Proxy(n,{get(e,t,r){if(t in e)return Reflect.get(e,t,r);const s=e.c[t];return typeof s=="function"?s.bind(e.c):s}})}var yr=class{get(n){return localStorage.getItem(n)}set(n,e){localStorage.setItem(n,e)}del(n){localStorage.removeItem(n)}};const Tr={trace:"#95bdb7",debug:"#ad95b8",info:"#b6bd73",warn:"#88a1bb",error:"#bf6c69"},vn={info:"⚡️",success:"✔",warn:"▲",error:"✖",log:"●",trace:"◔",debug:"◌"},Rr={bind(n,e,t){const r=t?`${vn[e]} ${String(t)}:`:`${vn[e]}`;return(n[e]||n.log).bind(n,`%c${r}%c`,`color: ${Tr[e]}; font-weight: bold;`,"color: inherit")}},tt=$n(new Er(new yr,Rr));function xr(n){let{editorData:e=[],effects:t={},scale:r=D.DEFAULT_SCALE,scaleSplitCount:s=D.DEFAULT_SCALE_SPLIT_COUNT,scaleWidth:o=D.DEFAULT_SCALE_WIDTH,startLeft:i=D.DEFAULT_START_LEFT,minScaleCount:a,maxScaleCount:c=1/0,rowHeight:u=D.DEFAULT_ROW_HEIGHT,autoScrollSpeed:l=1,autoScrollMaxSpeed:m=10}=n;r<=0&&(tt.error("Error: scale must be greater than 0!"),r=D.DEFAULT_SCALE),s<=0&&(tt.warn("Warning: scaleSplitCount cannot be less than 1!"),s=1),o<=0&&(tt.warn("Warning: scaleWidth must be greater than 0!"),o=D.DEFAULT_SCALE_WIDTH),i<0&&(tt.warn("Warning: startLeft cannot be less than 0!"),i=0),a&&typeof a=="number"&&(a<1&&(tt.warn("Warning: minScaleCount must be greater than 1!"),a=D.MIN_SCALE_COUNT),a=parseInt(a+""),c<a&&(tt.warn("Warning: maxScaleCount cannot be less than minScaleCount!"),c=a)),c=c===1/0?1/0:parseInt(c+""),u<=0&&(tt.warn("Warning: rowHeight must be greater than 0!"),u=D.DEFAULT_ROW_HEIGHT);const f={...n};return delete f.style,{...f,editorData:e,effects:t,scale:r,scaleSplitCount:s,scaleWidth:o,startLeft:i,minScaleCount:a,maxScaleCount:c,rowHeight:u,autoScrollSpeed:l,autoScrollMaxSpeed:m}}var Ut={exports:{}},tn={};var bn;function Ar(){if(bn)return tn;bn=1;var n=O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return tn.c=function(e){return n.H.useMemoCache(e)},tn}var nn={};var Sn;function Cr(){return Sn||(Sn=1,process.env.NODE_ENV!=="production"&&(function(){var n=O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;nn.c=function(e){var t=n.H;return t===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
7
7
  1. You might have mismatching versions of React and the renderer (such as React DOM)
8
8
  2. You might be breaking the Rules of Hooks
9
9
  3. You might have more than one copy of React in the same app
10
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),t.useMemoCache(e)}})()),Jt}var pn;function Rr(){return pn||(pn=1,process.env.NODE_ENV==="production"?It.exports=yr():It.exports=Tr()),It.exports}var Oe=Rr();const xr=n=>{const e=Oe.c(11),{isMoving:t,movePositions:r,assistPositions:s}=n;let o,i;if(e[0]!==t||e[1]!==r||e[2]!==s){const a=r===void 0?[]:r;let u;e[5]!==s?(u=s===void 0?[]:s,e[5]=s,e[6]=u):u=e[6];const l=u;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=ge("snap-line-container"),e[7]=o):o=e[7],i=t&&a.filter(m=>l.includes(m)).map(Ar),e[0]=t,e[1]=r,e[2]=s,e[3]=o,e[4]=i}else o=e[3],i=e[4];let c;return e[8]!==o||e[9]!==i?(c=T.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=c):c=e[10],c};function Ar(n,e){return T.jsx("div",{className:ge("snap-line"),style:{left:n}},e)}const kt=1,gn=10,vn=10;function Cr(n){const e=Oe.c(7),t=L.useRef(Number.MIN_SAFE_INTEGER),r=L.useRef(Number.MAX_SAFE_INTEGER),s=L.useRef(kt),o=L.useRef(void 0);let i;e[0]!==n?(i=()=>{if(n?.current){const{left:S,width:y}=n.current.getBoundingClientRect();t.current=S,r.current=S+y}},e[0]=n,e[1]=i):i=e[1];const c=i;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(S,y)=>{if(S.clientX>=r.current||S.clientX<=t.current){o.current!==void 0&&cancelAnimationFrame(o.current);const _=Math.abs(S.clientX>=r.current?S.clientX-r.current:S.clientX-t.current);s.current=Math.min(Number((_/vn).toFixed(0))*kt,gn);const p=(S.clientX>=r.current?1:-1)*s.current,v=()=>{y&&y(p),o.current=requestAnimationFrame(v)};return o.current=requestAnimationFrame(v),!1}else o.current!==void 0&&cancelAnimationFrame(o.current);return!0},e[2]=a):a=e[2];const u=a;let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=(S,y,_)=>{if(S.clientX>=r.current||S.clientX<t.current){o.current!==void 0&&cancelAnimationFrame(o.current);const h=Math.abs(S.clientX>=r.current?S.clientX-r.current:S.clientX-t.current);s.current=Math.min(Number((h/vn).toFixed(0))*kt,gn);const v=(S.clientX>=r.current?1:-1)*s.current,R=()=>{_&&_(v),o.current=requestAnimationFrame(R)};return o.current=requestAnimationFrame(R),!1}else o.current!==void 0&&cancelAnimationFrame(o.current);return!0},e[3]=l):l=e[3];const m=l;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{t.current=Number.MIN_SAFE_INTEGER,r.current=Number.MAX_SAFE_INTEGER,s.current=kt,o.current!==void 0&&cancelAnimationFrame(o.current)},e[4]=f):f=e[4];const g=f;let w;return e[5]!==c?(w={initAutoScroll:c,dealDragAutoScroll:u,dealResizeAutoScroll:m,stopAutoScroll:g},e[5]=c,e[6]=w):w=e[6],w}function Pr(n,e,t){return Math.max(e,Math.min(n,t))}const ve={toVector(n,e){return n===void 0&&(n=e),Array.isArray(n)?n:[n,n]},add(n,e){return[n[0]+e[0],n[1]+e[1]]},sub(n,e){return[n[0]-e[0],n[1]-e[1]]},addTo(n,e){n[0]+=e[0],n[1]+=e[1]},subTo(n,e){n[0]-=e[0],n[1]-=e[1]}};function bn(n,e,t){return e===0||Math.abs(e)===1/0?Math.pow(n,t*5):n*e*t/(e+t*n)}function Sn(n,e,t,r=.15){return r===0?Pr(n,e,t):n<e?-bn(e-n,t-e,r)+e:n>t?+bn(n-t,t-e,r)+t:n}function Lr(n,[e,t],[r,s]){const[[o,i],[c,a]]=n;return[Sn(e,o,i,r),Sn(t,c,a,s)]}function Dr(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Or(n){var e=Dr(n,"string");return typeof e=="symbol"?e:String(e)}function we(n,e,t){return e=Or(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _n(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function ee(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_n(Object(t),!0).forEach(function(r){we(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_n(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const jn={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function wn(n){return n?n[0].toUpperCase()+n.slice(1):""}const Mr=["enter","leave"];function Nr(n=!1,e){return n&&!Mr.includes(e)}function Ir(n,e="",t=!1){const r=jn[n],s=r&&r[e]||e;return"on"+wn(n)+wn(s)+(Nr(t,s)?"Capture":"")}const kr=["gotpointercapture","lostpointercapture"];function Wr(n){let e=n.substring(2).toLowerCase();const t=!!~e.indexOf("passive");t&&(e=e.replace("passive",""));const r=kr.includes(e)?"capturecapture":"capture",s=!!~e.indexOf(r);return s&&(e=e.replace("capture","")),{device:e,capture:s,passive:t}}function zr(n,e=""){const t=jn[n],r=t&&t[e]||e;return n+r}function Bt(n){return"touches"in n}function Fn(n){return Bt(n)?"touch":"pointerType"in n?n.pointerType:"mouse"}function jr(n){return Array.from(n.touches).filter(e=>{var t,r;return e.target===n.currentTarget||((t=n.currentTarget)===null||t===void 0||(r=t.contains)===null||r===void 0?void 0:r.call(t,e.target))})}function Fr(n){return n.type==="touchend"||n.type==="touchcancel"?n.changedTouches:n.targetTouches}function Un(n){return Bt(n)?Fr(n)[0]:n}function Ur(n){return jr(n).map(e=>e.identifier)}function Zt(n){const e=Un(n);return Bt(n)?e.identifier:e.pointerId}function En(n){const e=Un(n);return[e.clientX,e.clientY]}function Vr(n){const e={};if("buttons"in n&&(e.buttons=n.buttons),"shiftKey"in n){const{shiftKey:t,altKey:r,metaKey:s,ctrlKey:o}=n;Object.assign(e,{shiftKey:t,altKey:r,metaKey:s,ctrlKey:o})}return e}function Vt(n,...e){return typeof n=="function"?n(...e):n}function $r(){}function Hr(...n){return n.length===0?$r:n.length===1?n[0]:function(){let e;for(const t of n)e=t.apply(this,arguments)||e;return e}}function yn(n,e){return Object.assign({},e,n||{})}const Br=32;class Xr{constructor(e,t,r){this.ctrl=e,this.args=t,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:r,args:s}=this;t[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=s,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,r=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=r.from?Vt(r.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:r,shared:s}=this;t.args=this.args;let o=0;if(e&&(t.event=e,r.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,s.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,s.locked=!!document.pointerLockElement,Object.assign(s,Vr(e)),s.down=s.pressed=s.buttons%2===1||s.touches>0,o=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const E=t._delta.map(Math.abs);ve.addTo(t._distance,E)}this.axisIntent&&this.axisIntent(e);const[i,c]=t._movement,[a,u]=r.threshold,{_step:l,values:m}=t;if(r.hasCustomTransform?(l[0]===!1&&(l[0]=Math.abs(i)>=a&&m[0]),l[1]===!1&&(l[1]=Math.abs(c)>=u&&m[1])):(l[0]===!1&&(l[0]=Math.abs(i)>=a&&Math.sign(i)*a),l[1]===!1&&(l[1]=Math.abs(c)>=u&&Math.sign(c)*u)),t.intentional=l[0]!==!1||l[1]!==!1,!t.intentional)return;const f=[0,0];if(r.hasCustomTransform){const[E,C]=m;f[0]=l[0]!==!1?E-l[0]:0,f[1]=l[1]!==!1?C-l[1]:0}else f[0]=l[0]!==!1?i-l[0]:0,f[1]=l[1]!==!1?c-l[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(f);const g=t.offset,w=t._active&&!t._blocked||t.active;w&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=s[this.ingKey]=t._active,e&&(t.first&&("bounds"in r&&(t._bounds=Vt(r.bounds,t)),this.setup&&this.setup()),t.movement=f,this.computeOffset()));const[S,y]=t.offset,[[_,h],[p,v]]=t._bounds;t.overflow=[S<_?-1:S>h?1:0,y<p?-1:y>v?1:0],t._movementBound[0]=t.overflow[0]?t._movementBound[0]===!1?t._movement[0]:t._movementBound[0]:!1,t._movementBound[1]=t.overflow[1]?t._movementBound[1]===!1?t._movement[1]:t._movementBound[1]:!1;const R=t._active?r.rubberband||[0,0]:[0,0];if(t.offset=Lr(t._bounds,t.offset,R),t.delta=ve.sub(t.offset,g),this.computeMovement(),w&&(!t.last||o>Br)){t.delta=ve.sub(t.offset,g);const E=t.delta.map(Math.abs);ve.addTo(t.distance,E),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&o>0&&(t.velocity=[E[0]/o,E[1]/o],t.timeDelta=o)}}emit(){const e=this.state,t=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const s=this.handler(ee(ee(ee({},t),e),{},{[this.aliasKey]:e.values}));s!==void 0&&(e.memo=s)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function Yr([n,e],t){const r=Math.abs(n),s=Math.abs(e);if(r>s&&r>t)return"x";if(s>r&&s>t)return"y"}class Gr extends Xr{constructor(...e){super(...e),we(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=ve.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=ve.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,r=this.config;if(!t.axis&&e){const s=typeof r.axisThreshold=="object"?r.axisThreshold[Fn(e)]:r.axisThreshold;t.axis=Yr(t._movement,s)}t._blocked=(r.lockDirection||!!r.axis)&&!t.axis||!!r.axis&&r.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const Tn=n=>n,Rn=.15,sn={enabled(n=!0){return n},eventOptions(n,e,t){return ee(ee({},t.shared.eventOptions),n)},preventDefault(n=!1){return n},triggerAllEvents(n=!1){return n},rubberband(n=0){switch(n){case!0:return[Rn,Rn];case!1:return[0,0];default:return ve.toVector(n)}},from(n){if(typeof n=="function")return n;if(n!=null)return ve.toVector(n)},transform(n,e,t){const r=n||t.shared.transform;if(this.hasCustomTransform=!!r,process.env.NODE_ENV==="development"){const s=r||Tn;return o=>{const i=s(o);return(!isFinite(i[0])||!isFinite(i[1]))&&console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${i[0]},${[1]}]`),i}}return r||Tn},threshold(n){return ve.toVector(n,0)}};process.env.NODE_ENV==="development"&&Object.assign(sn,{domTarget(n){if(n!==void 0)throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");return NaN},lockDirection(n){if(n!==void 0)throw Error("[@use-gesture]: `lockDirection` option has been merged with `axis`. Use it as in `{ axis: 'lock' }`");return NaN},initial(n){if(n!==void 0)throw Error("[@use-gesture]: `initial` option has been renamed to `from`.");return NaN}});const qr=0,Pt=ee(ee({},sn),{},{axis(n,e,{axis:t}){if(this.lockDirection=t==="lock",!this.lockDirection)return t},axisThreshold(n=qr){return n},bounds(n={}){if(typeof n=="function")return o=>Pt.bounds(n(o));if("current"in n)return()=>n.current;if(typeof HTMLElement=="function"&&n instanceof HTMLElement)return n;const{left:e=-1/0,right:t=1/0,top:r=-1/0,bottom:s=1/0}=n;return[[e,t],[r,s]]}}),xn={ArrowRight:(n,e=1)=>[n*e,0],ArrowLeft:(n,e=1)=>[-1*n*e,0],ArrowUp:(n,e=1)=>[0,-1*n*e],ArrowDown:(n,e=1)=>[0,n*e]};class Kr extends Gr{constructor(...e){super(...e),we(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),s={left:t.left-r.left+e.offset[0],right:t.right-r.right+e.offset[0],top:t.top-r.top+e.offset[1],bottom:t.bottom-r.bottom+e.offset[1]};e._bounds=Pt.bounds(s)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,r=this.state;if(e.buttons!=null&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):t.pointerButtons!==-1&&t.pointerButtons!==e.buttons))return;const s=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(s&&s.size>1&&r._pointerActive)&&(this.start(e),this.setupPointer(e),r._pointerId=Zt(e),r._pointerActive=!0,this.computeValues(En(e)),this.computeInitial(),t.preventScrollAxis&&Fn(e)!=="mouse"?(r._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,r=this.config;if(!t._pointerActive)return;const s=Zt(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;const o=En(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=ve.sub(o,t._values),this.computeValues(o)),ve.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(r.preventScrollAxis&&!t._preventScroll)if(t.axis)if(t.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{process.env.NODE_ENV==="development"&&console.warn("[@use-gesture]: If you see this message, it's likely that you're using an outdated version of `@react-three/fiber`. \n\nPlease upgrade to the latest version.")}const t=this.state,r=this.config;if(!t._active||!t._pointerActive)return;const s=Zt(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[o,i]=t._distance;if(t.tap=o<=r.tapsThreshold&&i<=r.tapsThreshold,t.tap&&r.filterTaps)t._force=!0;else{const[c,a]=t._delta,[u,l]=t._movement,[m,f]=r.swipe.velocity,[g,w]=r.swipe.distance,S=r.swipe.duration;if(t.elapsedTime<S){const y=Math.abs(c/t.timeDelta),_=Math.abs(a/t.timeDelta);y>m&&Math.abs(u)>g&&(t.swipe[0]=Math.sign(c)),_>f&&Math.abs(l)>w&&(t.swipe[1]=Math.sign(a))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,r=t.device;if(process.env.NODE_ENV==="development")try{if(r==="pointer"&&t.preventScrollDelay===void 0){const s="uv"in e?e.sourceEvent.currentTarget:e.currentTarget;window.getComputedStyle(s).touchAction==="auto"&&console.warn("[@use-gesture]: The drag target has its `touch-action` style property set to `auto`. It is recommended to add `touch-action: 'none'` so that the drag gesture behaves correctly on touch-enabled devices. For more information read this: https://use-gesture.netlify.app/docs/extras/#touch-action.\n\nThis message will only show in development mode. It won't appear in production. If this is intended, you can ignore it.",s)}}catch{}t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,Jr(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=xn[e.key];if(t){const r=this.state,s=e.shiftKey?10:e.altKey?.1:1;this.start(e),r._delta=t(this.config.keyboardDisplacement,s),r._keyboardActive=!0,ve.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in xn&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function Jr(n){"persist"in n&&typeof n.persist=="function"&&n.persist()}const Lt=typeof window<"u"&&window.document&&window.document.createElement;function Vn(){return Lt&&"ontouchstart"in window}function Zr(){return Vn()||Lt&&window.navigator.maxTouchPoints>1}function Qr(){return Lt&&"onpointerdown"in window}function es(){return Lt&&"exitPointerLock"in window.document}function ts(){try{return"constructor"in GestureEvent}catch{return!1}}const Re={isBrowser:Lt,gesture:ts(),touch:Vn(),touchscreen:Zr(),pointer:Qr(),pointerLock:es()},ns=250,rs=180,ss=.5,os=50,is=250,cs=10,An={mouse:0,touch:0,pen:8},$n=ee(ee({},Pt),{},{device(n,e,{pointer:{touch:t=!1,lock:r=!1,mouse:s=!1}={}}){return this.pointerLock=r&&Re.pointerLock,Re.touch&&t?"touch":this.pointerLock?"mouse":Re.pointer&&!s?"pointer":Re.touch?"touch":"mouse"},preventScrollAxis(n,e,{preventScroll:t}){if(this.preventScrollDelay=typeof t=="number"?t:t||t===void 0&&n?ns:void 0,!(!Re.touchscreen||t===!1))return n||(t!==void 0?"y":void 0)},pointerCapture(n,e,{pointer:{capture:t=!0,buttons:r=1,keys:s=!0}={}}){return this.pointerButtons=r,this.keys=s,!this.pointerLock&&this.device==="pointer"&&t},threshold(n,e,{filterTaps:t=!1,tapsThreshold:r=3,axis:s=void 0}){const o=ve.toVector(n,t?r:s?1:0);return this.filterTaps=t,this.tapsThreshold=r,o},swipe({velocity:n=ss,distance:e=os,duration:t=is}={}){return{velocity:this.transform(ve.toVector(n)),distance:this.transform(ve.toVector(e)),duration:t}},delay(n=0){switch(n){case!0:return rs;case!1:return 0;default:return n}},axisThreshold(n){return n?ee(ee({},An),n):An},keyboardDisplacement(n=cs){return n}});process.env.NODE_ENV==="development"&&Object.assign($n,{useTouch(n){if(n!==void 0)throw Error("[@use-gesture]: `useTouch` option has been renamed to `pointer.touch`. Use it as in `{ pointer: { touch: true } }`.");return NaN},experimental_preventWindowScrollY(n){if(n!==void 0)throw Error("[@use-gesture]: `experimental_preventWindowScrollY` option has been renamed to `preventScroll`.");return NaN},swipeVelocity(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeVelocity` option has been renamed to `swipe.velocity`. Use it as in `{ swipe: { velocity: 0.5 } }`.");return NaN},swipeDistance(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeDistance` option has been renamed to `swipe.distance`. Use it as in `{ swipe: { distance: 50 } }`.");return NaN},swipeDuration(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeDuration` option has been renamed to `swipe.duration`. Use it as in `{ swipe: { duration: 250 } }`.");return NaN}});ee(ee({},sn),{},{device(n,e,{shared:t,pointer:{touch:r=!1}={}}){if(t.target&&!Re.touch&&Re.gesture)return"gesture";if(Re.touch&&r)return"touch";if(Re.touchscreen){if(Re.pointer)return"pointer";if(Re.touch)return"touch"}},bounds(n,e,{scaleBounds:t={},angleBounds:r={}}){const s=i=>{const c=yn(Vt(t,i),{min:-1/0,max:1/0});return[c.min,c.max]},o=i=>{const c=yn(Vt(r,i),{min:-1/0,max:1/0});return[c.min,c.max]};return typeof t!="function"&&typeof r!="function"?[s(),o()]:i=>[s(i),o(i)]},threshold(n,e,t){return this.lockDirection=t.axis==="lock",ve.toVector(n,this.lockDirection?[.1,3]:0)},modifierKey(n){return n===void 0?"ctrlKey":n},pinchOnWheel(n=!0){return n}});ee(ee({},Pt),{},{mouseOnly:(n=!0)=>n});ee(ee({},Pt),{},{mouseOnly:(n=!0)=>n});const Hn=new Map,nn=new Map;function as(n){Hn.set(n.key,n.engine),nn.set(n.key,n.resolver)}const ls={key:"drag",engine:Kr,resolver:$n};function us(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o<r.length;o++)s=r[o],!(e.indexOf(s)>=0)&&(t[s]=n[s]);return t}function fs(n,e){if(n==null)return{};var t=us(n,e),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}const ds={target(n){if(n)return()=>"current"in n?n.current:n},enabled(n=!0){return n},window(n=Re.isBrowser?window:void 0){return n},eventOptions({passive:n=!0,capture:e=!1}={}){return{passive:n,capture:e}},transform(n){return n}},hs=["target","eventOptions","window","enabled","transform"];function zt(n={},e){const t={};for(const[r,s]of Object.entries(e))switch(typeof s){case"function":if(process.env.NODE_ENV==="development"){const o=s.call(t,n[r],r,n);Number.isNaN(o)||(t[r]=o)}else t[r]=s.call(t,n[r],r,n);break;case"object":t[r]=zt(n[r],s);break;case"boolean":s&&(t[r]=n[r]);break}return t}function ms(n,e,t={}){const r=n,{target:s,eventOptions:o,window:i,enabled:c,transform:a}=r,u=fs(r,hs);if(t.shared=zt({target:s,eventOptions:o,window:i,enabled:c,transform:a},ds),e){const l=nn.get(e);t[e]=zt(ee({shared:t.shared},u),l)}else for(const l in u){const m=nn.get(l);if(m)t[l]=zt(ee({shared:t.shared},u[l]),m);else if(process.env.NODE_ENV==="development"&&!["drag","pinch","scroll","wheel","move","hover"].includes(l)){if(l==="domTarget")throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");console.warn(`[@use-gesture]: Unknown config key \`${l}\` was used. Please read the documentation for further information.`)}}return t}class Bn{constructor(e,t){we(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,r,s,o){const i=this._listeners,c=zr(t,r),a=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},u=ee(ee({},a),o);e.addEventListener(c,s,u);const l=()=>{e.removeEventListener(c,s,u),i.delete(l)};return i.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class ps{constructor(){we(this,"_timeouts",new Map)}add(e,t,r=140,...s){this.remove(e),this._timeouts.set(e,window.setTimeout(t,r,...s))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class gs{constructor(e){we(this,"gestures",new Set),we(this,"_targetEventStore",new Bn(this)),we(this,"gestureEventStores",{}),we(this,"gestureTimeoutStores",{}),we(this,"handlers",{}),we(this,"config",{}),we(this,"pointerIds",new Set),we(this,"touchIds",new Set),we(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),vs(this,e)}setEventIds(e){if(Bt(e))return this.touchIds=new Set(Ur(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=ms(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,r={};let s;if(!(t.target&&(s=t.target(),!s))){if(t.enabled){for(const i of this.gestures){const c=this.config[i],a=Cn(r,c.eventOptions,!!s);if(c.enabled){const u=Hn.get(i);new u(this,e,i).bind(a)}}const o=Cn(r,t.eventOptions,!!s);for(const i in this.nativeHandlers)o(i,"",c=>this.nativeHandlers[i](ee(ee({},this.state.shared),{},{event:c,args:e})),void 0,!0)}for(const o in r)r[o]=Hr(...r[o]);if(!s)return r;for(const o in r){const{device:i,capture:c,passive:a}=Wr(o);this._targetEventStore.add(s,i,"",r[o],{capture:c,passive:a})}}}}function Et(n,e){n.gestures.add(e),n.gestureEventStores[e]=new Bn(n,e),n.gestureTimeoutStores[e]=new ps}function vs(n,e){e.drag&&Et(n,"drag"),e.wheel&&Et(n,"wheel"),e.scroll&&Et(n,"scroll"),e.move&&Et(n,"move"),e.pinch&&Et(n,"pinch"),e.hover&&Et(n,"hover")}const Cn=(n,e,t)=>(r,s,o,i={},c=!1)=>{var a,u;const l=(a=i.capture)!==null&&a!==void 0?a:e.capture,m=(u=i.passive)!==null&&u!==void 0?u:e.passive;let f=c?r:Ir(r,s,l);t&&m&&(f+="Passive"),n[f]=n[f]||[],n[f].push(o)};function bs(n,e={},t,r){const s=L.useMemo(()=>new gs(n),[]);if(s.applyHandlers(n,r),s.applyConfig(e,t),L.useEffect(s.effect.bind(s)),L.useEffect(()=>s.clean.bind(s),[]),e.target===void 0)return s.bind.bind(s)}function Qt(n,e){return as(ls),bs({drag:n},e||{},"drag")}function Pn(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function Xn(...n){return e=>{let t=!1;const r=n.map(s=>{const o=Pn(s,e);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Pn(n[s],null)}}}}function nt(...n){return b.useCallback(Xn(...n),n)}function Yn(n){const e=_s(n),t=b.forwardRef((r,s)=>{const{children:o,...i}=r,c=b.Children.toArray(o),a=c.find(Es);if(a){const u=a.props.children,l=c.map(m=>m===a?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:m);return T.jsx(e,{...i,ref:s,children:b.isValidElement(u)?b.cloneElement(u,void 0,l):null})}return T.jsx(e,{...i,ref:s,children:o})});return t.displayName=`${n}.Slot`,t}var Ss=Yn("Slot");function _s(n){const e=b.forwardRef((t,r)=>{const{children:s,...o}=t;if(b.isValidElement(s)){const i=Ts(s),c=ys(o,s.props);return s.type!==b.Fragment&&(c.ref=r?Xn(r,i):i),b.cloneElement(s,c)}return b.Children.count(s)>1?b.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var ws=Symbol("radix.slottable");function Es(n){return b.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===ws}function ys(n,e){const t={...e};for(const r in e){const s=n[r],o=e[r];/^on[A-Z]/.test(r)?s&&o?t[r]=(...c)=>{const a=o(...c);return s(...c),a}:s&&(t[r]=s):r==="style"?t[r]={...s,...o}:r==="className"&&(t[r]=[s,o].filter(Boolean).join(" "))}return{...n,...t}}function Ts(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var Rs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Dt=Rs.reduce((n,e)=>{const t=Yn(`Primitive.${e}`),r=b.forwardRef((s,o)=>{const{asChild:i,...c}=s,a=i?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(a,{...c,ref:o})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{});function xs(n,e=[]){let t=[];function r(o,i){const c=b.createContext(i),a=t.length;t=[...t,i];const u=m=>{const{scope:f,children:g,...w}=m,S=f?.[n]?.[a]||c,y=b.useMemo(()=>w,Object.values(w));return T.jsx(S.Provider,{value:y,children:g})};u.displayName=o+"Provider";function l(m,f){const g=f?.[n]?.[a]||c,w=b.useContext(g);if(w)return w;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[u,l]}const s=()=>{const o=t.map(i=>b.createContext(i));return function(c){const a=c?.[n]||o;return b.useMemo(()=>({[`__scope${n}`]:{...c,[n]:a}}),[c,a])}};return s.scopeName=n,[r,As(s,...e)]}function As(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((c,{useScope:a,scopeName:u})=>{const m=a(o)[`__scope${u}`];return{...c,...m}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return t.scopeName=e.scopeName,t}function tt(n,e,{checkForDefaultPrevented:t=!0}={}){return function(s){if(n?.(s),t===!1||!s.defaultPrevented)return e?.(s)}}var rn=globalThis?.document?b.useLayoutEffect:()=>{};function Cs(n,e){return b.useReducer((t,r)=>e[t][r]??t,n)}var Ot=n=>{const{present:e,children:t}=n,r=Ps(e),s=typeof t=="function"?t({present:r.isPresent}):b.Children.only(t),o=nt(r.ref,Ls(s));return typeof t=="function"||r.isPresent?b.cloneElement(s,{ref:o}):null};Ot.displayName="Presence";function Ps(n){const[e,t]=b.useState(),r=b.useRef(null),s=b.useRef(n),o=b.useRef("none"),i=n?"mounted":"unmounted",[c,a]=Cs(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=Wt(r.current);o.current=c==="mounted"?u:"none"},[c]),rn(()=>{const u=r.current,l=s.current;if(l!==n){const f=o.current,g=Wt(u);n?a("MOUNT"):g==="none"||u?.display==="none"?a("UNMOUNT"):a(l&&f!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=n}},[n,a]),rn(()=>{if(e){let u;const l=e.ownerDocument.defaultView??window,m=g=>{const S=Wt(r.current).includes(CSS.escape(g.animationName));if(g.target===e&&S&&(a("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=l.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},f=g=>{g.target===e&&(o.current=Wt(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{l.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else a("ANIMATION_END")},[e,a]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:b.useCallback(u=>{r.current=u?getComputedStyle(u):null,t(u)},[])}}function Wt(n){return n?.animationName||"none"}function Ls(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var Ds=b.createContext(void 0);function Os(n){const e=b.useContext(Ds);return n||e||"ltr"}function et(n){const e=b.useRef(n);return b.useEffect(()=>{e.current=n}),b.useMemo(()=>(...t)=>e.current?.(...t),[])}function Ms(n,[e,t]){return Math.min(t,Math.max(e,n))}function Ns(n,e){return b.useReducer((t,r)=>e[t][r]??t,n)}var on="ScrollArea",[Gn]=xs(on),[Is,xe]=Gn(on),qn=b.forwardRef((n,e)=>{const{__scopeScrollArea:t,type:r="hover",dir:s,scrollHideDelay:o=600,...i}=n,[c,a]=b.useState(null),[u,l]=b.useState(null),[m,f]=b.useState(null),[g,w]=b.useState(null),[S,y]=b.useState(null),[_,h]=b.useState(0),[p,v]=b.useState(0),[R,E]=b.useState(!1),[C,z]=b.useState(!1),D=nt(e,H=>a(H)),j=Os(s);return T.jsx(Is,{scope:t,type:r,dir:j,scrollHideDelay:o,scrollArea:c,viewport:u,onViewportChange:l,content:m,onContentChange:f,scrollbarX:g,onScrollbarXChange:w,scrollbarXEnabled:R,onScrollbarXEnabledChange:E,scrollbarY:S,onScrollbarYChange:y,scrollbarYEnabled:C,onScrollbarYEnabledChange:z,onCornerWidthChange:h,onCornerHeightChange:v,children:T.jsx(Dt.div,{dir:j,...i,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":_+"px","--radix-scroll-area-corner-height":p+"px",...n.style}})})});qn.displayName=on;var Kn="ScrollAreaViewport",Jn=b.forwardRef((n,e)=>{const{__scopeScrollArea:t,children:r,nonce:s,...o}=n,i=xe(Kn,t),c=b.useRef(null),a=nt(e,c,i.onViewportChange);return T.jsxs(T.Fragment,{children:[T.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),T.jsx(Dt.div,{"data-radix-scroll-area-viewport":"",...o,ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...n.style},children:T.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Jn.displayName=Kn;var Me="ScrollAreaScrollbar",Zn=b.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=xe(Me,n.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,c=n.orientation==="horizontal";return b.useEffect(()=>(c?o(!0):i(!0),()=>{c?o(!1):i(!1)}),[c,o,i]),s.type==="hover"?T.jsx(ks,{...r,ref:e,forceMount:t}):s.type==="scroll"?T.jsx(Ws,{...r,ref:e,forceMount:t}):s.type==="auto"?T.jsx(Qn,{...r,ref:e,forceMount:t}):s.type==="always"?T.jsx(cn,{...r,ref:e}):null});Zn.displayName=Me;var ks=b.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=xe(Me,n.__scopeScrollArea),[o,i]=b.useState(!1);return b.useEffect(()=>{const c=s.scrollArea;let a=0;if(c){const u=()=>{window.clearTimeout(a),i(!0)},l=()=>{a=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",l),()=>{window.clearTimeout(a),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",l)}}},[s.scrollArea,s.scrollHideDelay]),T.jsx(Ot,{present:t||o,children:T.jsx(Qn,{"data-state":o?"visible":"hidden",...r,ref:e})})}),Ws=b.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=xe(Me,n.__scopeScrollArea),o=n.orientation==="horizontal",i=Yt(()=>a("SCROLL_END"),100),[c,a]=Ns("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>a("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,s.scrollHideDelay,a]),b.useEffect(()=>{const u=s.viewport,l=o?"scrollLeft":"scrollTop";if(u){let m=u[l];const f=()=>{const g=u[l];m!==g&&(a("SCROLL"),i()),m=g};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[s.viewport,o,a,i]),T.jsx(Ot,{present:t||c!=="hidden",children:T.jsx(cn,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:tt(n.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:tt(n.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),Qn=b.forwardRef((n,e)=>{const t=xe(Me,n.__scopeScrollArea),{forceMount:r,...s}=n,[o,i]=b.useState(!1),c=n.orientation==="horizontal",a=Yt(()=>{if(t.viewport){const u=t.viewport.offsetWidth<t.viewport.scrollWidth,l=t.viewport.offsetHeight<t.viewport.scrollHeight;i(c?u:l)}},10);return Rt(t.viewport,a),Rt(t.content,a),T.jsx(Ot,{present:r||o,children:T.jsx(cn,{"data-state":o?"visible":"hidden",...s,ref:e})})}),cn=b.forwardRef((n,e)=>{const{orientation:t="vertical",...r}=n,s=xe(Me,n.__scopeScrollArea),o=b.useRef(null),i=b.useRef(0),[c,a]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=sr(c.viewport,c.content),l={...r,sizes:c,onSizesChange:a,hasThumb:u>0&&u<1,onThumbChange:f=>o.current=f,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:f=>i.current=f};function m(f,g){return $s(f,i.current,c,g)}return t==="horizontal"?T.jsx(zs,{...l,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollLeft,g=Ln(f,c,s.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollLeft=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollLeft=m(f,s.dir))}}):t==="vertical"?T.jsx(js,{...l,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollTop,g=Ln(f,c);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollTop=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollTop=m(f))}}):null}),zs=b.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=xe(Me,n.__scopeScrollArea),[i,c]=b.useState(),a=b.useRef(null),u=nt(e,a,o.onScrollbarXChange);return b.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),T.jsx(tr,{"data-orientation":"horizontal",...s,ref:u,sizes:t,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Xt(t)+"px",...n.style},onThumbPointerDown:l=>n.onThumbPointerDown(l.x),onDragScroll:l=>n.onDragScroll(l.x),onWheelScroll:(l,m)=>{if(o.viewport){const f=o.viewport.scrollLeft+l.deltaX;n.onWheelScroll(f),ir(f,m)&&l.preventDefault()}},onResize:()=>{a.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:Ht(i.paddingLeft),paddingEnd:Ht(i.paddingRight)}})}})}),js=b.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=xe(Me,n.__scopeScrollArea),[i,c]=b.useState(),a=b.useRef(null),u=nt(e,a,o.onScrollbarYChange);return b.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),T.jsx(tr,{"data-orientation":"vertical",...s,ref:u,sizes:t,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Xt(t)+"px",...n.style},onThumbPointerDown:l=>n.onThumbPointerDown(l.y),onDragScroll:l=>n.onDragScroll(l.y),onWheelScroll:(l,m)=>{if(o.viewport){const f=o.viewport.scrollTop+l.deltaY;n.onWheelScroll(f),ir(f,m)&&l.preventDefault()}},onResize:()=>{a.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:Ht(i.paddingTop),paddingEnd:Ht(i.paddingBottom)}})}})}),[Fs,er]=Gn(Me),tr=b.forwardRef((n,e)=>{const{__scopeScrollArea:t,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:c,onThumbPositionChange:a,onDragScroll:u,onWheelScroll:l,onResize:m,...f}=n,g=xe(Me,t),[w,S]=b.useState(null),y=nt(e,D=>S(D)),_=b.useRef(null),h=b.useRef(""),p=g.viewport,v=r.content-r.viewport,R=et(l),E=et(a),C=Yt(m,10);function z(D){if(_.current){const j=D.clientX-_.current.left,H=D.clientY-_.current.top;u({x:j,y:H})}}return b.useEffect(()=>{const D=j=>{const H=j.target;w?.contains(H)&&R(j,v)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[p,w,v,R]),b.useEffect(E,[r,E]),Rt(w,C),Rt(g.content,C),T.jsx(Fs,{scope:t,scrollbar:w,hasThumb:s,onThumbChange:et(o),onThumbPointerUp:et(i),onThumbPositionChange:E,onThumbPointerDown:et(c),children:T.jsx(Dt.div,{...f,ref:y,style:{position:"absolute",...f.style},onPointerDown:tt(n.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),_.current=w.getBoundingClientRect(),h.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),z(D))}),onPointerMove:tt(n.onPointerMove,z),onPointerUp:tt(n.onPointerUp,D=>{const j=D.target;j.hasPointerCapture(D.pointerId)&&j.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=h.current,g.viewport&&(g.viewport.style.scrollBehavior=""),_.current=null})})})}),$t="ScrollAreaThumb",nr=b.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=er($t,n.__scopeScrollArea);return T.jsx(Ot,{present:t||s.hasThumb,children:T.jsx(Us,{ref:e,...r})})}),Us=b.forwardRef((n,e)=>{const{__scopeScrollArea:t,style:r,...s}=n,o=xe($t,t),i=er($t,t),{onThumbPositionChange:c}=i,a=nt(e,m=>i.onThumbChange(m)),u=b.useRef(void 0),l=Yt(()=>{u.current&&(u.current(),u.current=void 0)},100);return b.useEffect(()=>{const m=o.viewport;if(m){const f=()=>{if(l(),!u.current){const g=Hs(m,c);u.current=g,c()}};return c(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[o.viewport,l,c]),T.jsx(Dt.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:tt(n.onPointerDownCapture,m=>{const g=m.target.getBoundingClientRect(),w=m.clientX-g.left,S=m.clientY-g.top;i.onThumbPointerDown({x:w,y:S})}),onPointerUp:tt(n.onPointerUp,i.onThumbPointerUp)})});nr.displayName=$t;var an="ScrollAreaCorner",rr=b.forwardRef((n,e)=>{const t=xe(an,n.__scopeScrollArea),r=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&r?T.jsx(Vs,{...n,ref:e}):null});rr.displayName=an;var Vs=b.forwardRef((n,e)=>{const{__scopeScrollArea:t,...r}=n,s=xe(an,t),[o,i]=b.useState(0),[c,a]=b.useState(0),u=!!(o&&c);return Rt(s.scrollbarX,()=>{const l=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(l),a(l)}),Rt(s.scrollbarY,()=>{const l=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(l),i(l)}),u?T.jsx(Dt.div,{...r,ref:e,style:{width:o,height:c,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null});function Ht(n){return n?parseInt(n,10):0}function sr(n,e){const t=n/e;return isNaN(t)?0:t}function Xt(n){const e=sr(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}function $s(n,e,t,r="ltr"){const s=Xt(t),o=s/2,i=e||o,c=s-i,a=t.scrollbar.paddingStart+i,u=t.scrollbar.size-t.scrollbar.paddingEnd-c,l=t.content-t.viewport,m=r==="ltr"?[0,l]:[l*-1,0];return or([a,u],m)(n)}function Ln(n,e,t="ltr"){const r=Xt(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-s,i=e.content-e.viewport,c=o-r,a=t==="ltr"?[0,i]:[i*-1,0],u=Ms(n,a);return or([0,i],[0,c])(u)}function or(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function ir(n,e){return n>0&&n<e}var Hs=(n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},r=0;return(function s(){const o={left:n.scrollLeft,top:n.scrollTop},i=t.left!==o.left,c=t.top!==o.top;(i||c)&&e(),t=o,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function Yt(n,e){const t=et(n),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}function Rt(n,e){const t=et(e);rn(()=>{let r=0;if(n){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)});return s.observe(n),()=>{window.cancelAnimationFrame(r),s.unobserve(n)}}},[n,t])}var Bs=qn,Xs=Jn,Ys=rr;const en=(n,e,t,r,s)=>({target:n,dx:e[0],dy:e[1],clientX:t[0],clientY:t[1],...r&&{edges:r},...s&&{deltaRect:s}}),Gs=(n,e,t)=>n?n===e||n===t||(e?.contains(n)??!1)||(t?.contains(n)??!1):!1,qs=n=>{const e=Oe.c(34),{children:t,style:r,draggable:s,resizable:o,draggableOptions:i,resizableOptions:c,ref:a}=n,u=L.useRef(void 0),l=L.useRef(void 0),m=L.useRef(null),f=L.useRef(null),g=L.useRef(void 0),w=L.useRef(void 0);let S,y;e[0]!==i||e[1]!==a||e[2]!==c?(S=()=>{if(u.current=i,l.current=c,!a?.current)return;const P=c?.edges?.left,I=c?.edges?.right;P&&P!==g.current&&(g.current=P,m.current=a.current.querySelector(P)),I&&I!==w.current&&(w.current=I,f.current=a.current.querySelector(I))},y=[i,a,c],e[0]=i,e[1]=a,e[2]=c,e[3]=S,e[4]=y):(S=e[3],y=e[4]),L.useEffect(S,y);let _;e[5]!==a?(_=P=>{const{active:I,delta:J,xy:Z,event:Q,first:d,last:x}=P,M=a?.current;if(!M||Gs(Q?.target,m.current,f.current))return;const $=en(M,J,Z);d?u.current?.onstart?.($):x?u.current?.onend?.($):I&&u.current?.onmove?.($)},e[5]=a,e[6]=_):_=e[6];const h=i?.lockAxis==="x"?"x":void 0;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={capture:!0},e[7]=p):p=e[7];let v;e[8]!==s||e[9]!==a||e[10]!==h?(v={enabled:s,axis:h,pointer:p,target:a,threshold:0},e[8]=s,e[9]=a,e[10]=h,e[11]=v):v=e[11],Qt(_,v);let R;e[12]!==a?(R=P=>{const{active:I,delta:J,xy:Z,first:Q,last:d}=P,x=a?.current;if(!x)return;const M=en(x,J,Z,{left:!0},{left:J[0]});Q?l.current?.onstart?.(M):d?l.current?.onend?.(M):I&&l.current?.onmove?.(M)},e[12]=a,e[13]=R):R=e[13];let E;e[14]===Symbol.for("react.memo_cache_sentinel")?(E={capture:!0},e[14]=E):E=e[14];let C;e[15]!==o?(C={enabled:o,target:m,pointer:E,threshold:0},e[15]=o,e[16]=C):C=e[16],Qt(R,C);let z;e[17]!==a?(z=P=>{const{active:I,delta:J,xy:Z,first:Q,last:d}=P,x=a?.current;if(!x)return;const M=en(x,J,Z,{right:!0},{right:J[0]});Q?l.current?.onstart?.(M):d?l.current?.onend?.(M):I&&l.current?.onmove?.(M)},e[17]=a,e[18]=z):z=e[18];let D;e[19]===Symbol.for("react.memo_cache_sentinel")?(D={capture:!0},e[19]=D):D=e[19];let j;e[20]!==o?(j={enabled:o,target:f,pointer:D,threshold:0},e[20]=o,e[21]=j):j=e[21],Qt(z,j);let H,te;e[22]!==a?(H=()=>{const P=a?.current;if(!P)return;const I=l.current?.edges?.left,J=l.current?.edges?.right;I&&(m.current=P.querySelector(I)),J&&(f.current=P.querySelector(J))},te=[a],e[22]=a,e[23]=H,e[24]=te):(H=e[23],te=e[24]),L.useLayoutEffect(H,te);let B;e[25]!==s?(B=s?{touchAction:"none"}:{},e[25]=s,e[26]=B):B=e[26];let re;e[27]!==r||e[28]!==B?(re={...B,...r},e[27]=r,e[28]=B,e[29]=re):re=e[29];let q;return e[30]!==t||e[31]!==a||e[32]!==re?(q=T.jsx(Ss,{ref:a,style:re,draggable:!1,children:t}),e[30]=t,e[31]=a,e[32]=re,e[33]=q):q=e[33],q},_e=(n,e=0)=>n?parseFloat(n):e,tn=(n,e,t,r=Number.MAX_SAFE_INTEGER)=>{let s=n,o=r;for(const i of e){const c=Math.abs(i-n);c<t&&c<o&&(s=i,o=c)}return{snap:s,minDis:o}},cr=L.forwardRef((n,e)=>{const t=Oe.c(68),{children:r,edges:s,left:o,width:i,start:c,grid:a,getBounds:u,enableResizing:l,enableDragging:m,snapDistance:f,snapPositions:g,onResizeStart:w,onResize:S,onResizeEnd:y,onDragStart:_,onDragEnd:h,onDrag:p,parentRef:v,autoScroll:R}=n,E=c===void 0?A.DEFAULT_START_LEFT:c,C=a===void 0?A.DEFAULT_MOVE_GRID:a,z=u===void 0?Ks:u,D=l===void 0?!0:l,j=m===void 0?!0:m,H=f===void 0?A.DEFAULT_SNAP_DISTANCE:f;let te;t[0]!==g?(te=g===void 0?[]:g,t[0]=g,t[1]=te):te=t[1];const B=te,re=R===void 0?!0:R,q=L.useRef(null),P=L.useRef(0),I=L.useRef(!1),{initAutoScroll:J,stopAutoScroll:Z,dealDragAutoScroll:Q,dealResizeAutoScroll:d}=Cr(v);let x;t[2]===Symbol.for("react.memo_cache_sentinel")?(x=(V,K)=>{const X=K===void 0?!0:K;if(!q.current)return;X&&(P.current=0);const Y=q.current;Y.style.setProperty("--translate-x",`${V}px`),Y.dataset.left=String(V)},t[2]=x):x=t[2];const M=x;let $;t[3]===Symbol.for("react.memo_cache_sentinel")?($=(V,K)=>{const X=K===void 0?!0:K;if(!q.current)return;X&&(P.current=0);const Y=q.current;Y.style.width=`${V}px`,Y.dataset.width=String(V)},t[3]=$):$=t[3];const fe=$;let k;t[4]===Symbol.for("react.memo_cache_sentinel")?(k=()=>q.current?_e(q.current.dataset.left):0,t[4]=k):k=t[4];const U=k;let N;t[5]===Symbol.for("react.memo_cache_sentinel")?(N=()=>q.current?_e(q.current.dataset.width):0,t[5]=N):N=t[5];const W=N;let O,Ne;t[6]!==i?(O=()=>{if(!q.current)return;const V=q.current;fe(typeof i>"u"?V.offsetWidth:i,!1)},Ne=[i],t[6]=i,t[7]=O,t[8]=Ne):(O=t[7],Ne=t[8]),L.useEffect(O,Ne);let Ae,ne;t[9]!==o?(Ae=()=>{M(o||0,!1)},ne=[o],t[9]=o,t[10]=Ae,t[11]=ne):(Ae=t[10],ne=t[11]),L.useEffect(Ae,ne);let se;t[12]===Symbol.for("react.memo_cache_sentinel")?(se=()=>({updateLeft:V=>M(V||0,!1),updateWidth:V=>fe(V,!1),getLeft:U,getWidth:W}),t[12]=se):se=t[12],L.useImperativeHandle(e,se);let Ee;t[13]!==J||t[14]!==_?(Ee=()=>{P.current=0,I.current=!1,J(),_?.()},t[13]=J,t[14]=_,t[15]=Ee):Ee=t[15];const Fe=Ee;let Ie;t[16]!==z||t[17]!==C||t[18]!==p||t[19]!==H||t[20]!==B||t[21]!==E?(Ie=V=>{const{preLeft:K,preWidth:X,scrollDelta:Y}=V;Y&&(P.current=P.current+Y);const me=I.current?H:C;if(Math.abs(P.current)<me)return;const ae=Math.trunc(P.current/me);let G=K+ae*me;const oe=P.current>0,F=oe?G+X:G,{snap:le}=tn(F,B,H);if(le!==F)I.current=!0,G=oe?le-X:le;else{const de=G-E;de%C!==0&&(G=E+C*Math.round(de/C)),I.current=!1}P.current=P.current%me;const ie=z();G<ie.left?G=ie.left:G+X>ie.right&&(G=ie.right-X),!(p&&p({lastLeft:K,left:G,lastWidth:X,width:X},Y)===!1)&&M(G,!1)},t[16]=z,t[17]=C,t[18]=p,t[19]=H,t[20]=B,t[21]=E,t[22]=Ie):Ie=t[22];const Pe=Ie;let ke;t[23]!==re||t[24]!==Q||t[25]!==Pe||t[26]!==v?(ke=V=>{const K=V.target,X=_e(K.dataset.left),Y=_e(K.dataset.width);P.current=P.current+V.dx,!(re&&v?.current&&!Q(V,G=>{if(!v?.current||!q.current)return;v.current.scrollLeft=v.current.scrollLeft+G;const oe=q.current,F=_e(oe.dataset.left),le=_e(oe.dataset.width);Pe({preLeft:F,preWidth:le,scrollDelta:G})}))&&Pe({preLeft:X,preWidth:Y})},t[23]=re,t[24]=Q,t[25]=Pe,t[26]=v,t[27]=ke):ke=t[27];const xt=ke;let rt;t[28]!==h||t[29]!==Z?(rt=V=>{P.current=0,I.current=!1,Z();const K=V.target;h?.({left:_e(K.dataset.left),width:_e(K.dataset.width)})},t[28]=h,t[29]=Z,t[30]=rt):rt=t[30];const Ue=rt;let ye;t[31]!==J||t[32]!==w?(ye=V=>{P.current=0,I.current=!1,J();const K=V.edges?.right?"right":"left";w?.(K)},t[31]=J,t[32]=w,t[33]=ye):ye=t[33];const Ve=ye;let We;t[34]!==z||t[35]!==C||t[36]!==S||t[37]!==H||t[38]!==B||t[39]!==E?(We=V=>{const{dir:K,preWidth:X,preLeft:Y,scrollDelta:me}=V;me&&(P.current=P.current+me);const ae=I.current?H:C;if(Math.abs(P.current)<ae)return;const G=z();if(K==="left"){const oe=Math.trunc(P.current/ae);let F=Y+oe*ae;const{snap:le}=tn(F,B,H);if(le!==F)I.current=!0,F=le;else{const Te=F-E;Te%C!==0&&(F=E+C*Math.round(Te/C)),I.current=!1}P.current=P.current%ae,F<G.left&&(F=G.left);const ie=Y+X,de=ie-F;if(F>=ie||S&&S("left",{lastLeft:Y,lastWidth:X,left:F,width:de})===!1)return;M(F,!1),fe(de,!1)}else{const oe=Math.trunc(P.current/ae);let F=X+oe*ae;const le=Y+F,{snap:ie}=tn(le,B,H);if(ie!==le)I.current=!0,F=ie-Y;else{let de=Y+F;const Te=de-E;Te%C!==0&&(de=E+C*Math.round(Te/C),F=de-Y),I.current=!1}if(P.current=P.current%ae,Y+F>G.right&&(F=G.right-Y),F<=0||S&&S("right",{lastLeft:Y,lastWidth:X,left:Y,width:F})===!1)return;fe(F,!1)}},t[34]=z,t[35]=C,t[36]=S,t[37]=H,t[38]=B,t[39]=E,t[40]=We):We=t[40];const $e=We;let ze;t[41]!==re||t[42]!==d||t[43]!==v||t[44]!==$e?(ze=V=>{const K=V.target,X=V.edges?.left?"left":"right",Y=_e(K.dataset.left),me=_e(K.dataset.width);P.current=P.current+(X==="left"?V.deltaRect?.left||0:V.deltaRect?.right||0),!(re&&v?.current&&!d(V,X,oe=>{if(!v?.current||!q.current)return;v.current.scrollLeft=v.current.scrollLeft+oe;const F=q.current,le=_e(F.dataset.left),ie=_e(F.dataset.width);$e({preLeft:le,preWidth:ie,dir:X,scrollDelta:oe})}))&&$e({preLeft:Y,preWidth:me,dir:X})},t[41]=re,t[42]=d,t[43]=v,t[44]=$e,t[45]=ze):ze=t[45];const Le=ze;let je;t[46]!==y||t[47]!==Z?(je=V=>{P.current=0,I.current=!1,Z();const K=V.target,X=V.edges?.right?"right":"left";y?.(X,{left:_e(K.dataset.left),width:_e(K.dataset.width)})},t[46]=y,t[47]=Z,t[48]=je):je=t[48];const Ze=je,He=`${o||0}px`;let Be;t[49]!==He||t[50]!==i?(Be={"--translate-x":He,transform:"translateX(var(--translate-x)) scaleX(var(--scale-x,1))",width:i},t[49]=He,t[50]=i,t[51]=Be):Be=t[51];const Xe=Be;let De;t[52]!==xt||t[53]!==Fe||t[54]!==Ue?(De={lockAxis:"x",onmove:xt,onstart:Fe,onend:Ue,cursorChecker:Js},t[52]=xt,t[53]=Fe,t[54]=Ue,t[55]=De):De=t[55];let Ce;t[56]!==s||t[57]!==Le||t[58]!==Ve||t[59]!==Ze?(Ce={axis:"x",invert:"none",edges:s,onmove:Le,onstart:Ve,onend:Ze},t[56]=s,t[57]=Le,t[58]=Ve,t[59]=Ze,t[60]=Ce):Ce=t[60];let Ye;return t[61]!==r||t[62]!==j||t[63]!==D||t[64]!==Xe||t[65]!==De||t[66]!==Ce?(Ye=T.jsx(qs,{style:Xe,ref:q,draggable:j,resizable:D,draggableOptions:De,resizableOptions:Ce,children:r}),t[61]=r,t[62]=j,t[63]=D,t[64]=Xe,t[65]=De,t[66]=Ce,t[67]=Ye):Ye=t[67],Ye});function Ks(){return{left:Number.MIN_SAFE_INTEGER,right:Number.MAX_SAFE_INTEGER}}function Js(){return""}function Zs(){let n=0,e,t="",r=arguments.length;for(;n<r;n++)(e=arguments[n])&&typeof e=="string"&&(t+=(t&&" ")+e);return t}const Qs=n=>{const e=Oe.c(191),{editorData:t,row:r,action:s,effects:o,rowHeight:i,scale:c,scaleWidth:a,scaleSplitCount:u,startLeft:l,gridSnap:m,disableDrag:f,scaleCount:g,maxScaleCount:w,setScaleCount:S,onActionMoveStart:y,onActionMoving:_,onActionMoveEnd:h,onActionResizeStart:p,onActionResizeEnd:v,onActionResizing:R,snapData:E,setEditorData:C,onClickAction:z,onClickActionOnly:D,onDoubleClickAction:j,onContextMenuAction:H,getActionRender:te,handleTime:B,scrollContainerRef:re}=n,q=L.useRef(null),P=L.useRef(!1),{id:I,maxEnd:J,minStart:Z,end:Q,start:d,selected:x,flexible:M,movable:$,effectId:fe}=s,k=M===void 0?!0:M,U=$===void 0?!0:$,N=c??A.DEFAULT_SCALE,W=a??A.DEFAULT_SCALE_WIDTH,O=l??A.DEFAULT_START_LEFT,Ne=u??A.DEFAULT_SCALE_SPLIT_COUNT,Ae=w??Number.MAX_SAFE_INTEGER,ne=Z||0;let se;e[0]!==N||e[1]!==W||e[2]!==O||e[3]!==ne?(se=A.parserTimeToPixel(ne,{startLeft:O,scale:N,scaleWidth:W}),e[0]=N,e[1]=W,e[2]=O,e[3]=ne,e[4]=se):se=e[4];const Ee=se,Fe=J||Number.MAX_VALUE;let Ie;e[5]!==N||e[6]!==W||e[7]!==O||e[8]!==Fe?(Ie=A.parserTimeToPixel(Fe,{startLeft:O,scale:N,scaleWidth:W}),e[5]=N,e[6]=W,e[7]=O,e[8]=Fe,e[9]=Ie):Ie=e[9];const Pe=Math.min(Ae*W+O,Ie);let ke;e[10]!==Q||e[11]!==N||e[12]!==W||e[13]!==O||e[14]!==d?(ke=A.parserTimeToTransform({start:d,end:Q},{startLeft:O,scale:N,scaleWidth:W}),e[10]=Q,e[11]=N,e[12]=W,e[13]=O,e[14]=d,e[15]=ke):ke=e[15];const xt=ke,[rt,Ue]=L.useState(null),ye=rt??xt,Ve=W/Ne;let We;e[16]!==fe||e[17]!==o||e[18]!==k||e[19]!==U||e[20]!==x?(We=ge(Zs("action",U&&"action-movable",x&&"action-selected",k&&"action-flexible",o[fe]&&`action-effect-${fe}`)),e[16]=fe,e[17]=o,e[18]=k,e[19]=U,e[20]=x,e[21]=We):We=e[21];const $e=We;let ze;e[22]!==W||e[23]!==O||e[24]!==g||e[25]!==S?(ze=(be,Se)=>{const ce=A.getScaleCountByPixel(be+Se,{startLeft:O,scaleCount:g,scaleWidth:W});ce!==g&&S(ce)},e[22]=W,e[23]=O,e[24]=g,e[25]=S,e[26]=ze):ze=e[26];const Le=ze;let je;e[27]!==s||e[28]!==y||e[29]!==r?(je=()=>{y&&y({action:s,row:r})},e[27]=s,e[28]=y,e[29]=r,e[30]=je):je=e[30];const Ze=je;let He;e[31]!==s||e[32]!==Le||e[33]!==_||e[34]!==r||e[35]!==N||e[36]!==W||e[37]!==O?(He=be=>{const{left:Se,width:ce}=be;if(P.current=!0,_){const{start:pe,end:ue}=A.parserTransformToTime({left:Se,width:ce},{scaleWidth:W,scale:N,startLeft:O});if(_({action:s,row:r,start:pe,end:ue})===!1)return!1}Ue({left:Se,width:ce}),Le(Se,ce)},e[31]=s,e[32]=Le,e[33]=_,e[34]=r,e[35]=N,e[36]=W,e[37]=O,e[38]=He):He=e[38];const Be=He;let Xe;e[39]!==t||e[40]!==I||e[41]!==h||e[42]!==r||e[43]!==N||e[44]!==W||e[45]!==O||e[46]!==C?(Xe=be=>{const{left:Se,width:ce}=be,{start:pe,end:ue}=A.parserTransformToTime({left:Se,width:ce},{scaleWidth:W,scale:N,startLeft:O}),he=t.find(Je=>Je.id===r.id);if(!he)return;const Ke=he.actions.find(Je=>Je.id===I);Ke&&(Ke.start=pe,Ke.end=ue,C(t),h&&h({action:Ke,row:r,start:pe,end:ue}),Ue(null))},e[39]=t,e[40]=I,e[41]=h,e[42]=r,e[43]=N,e[44]=W,e[45]=O,e[46]=C,e[47]=Xe):Xe=e[47];const De=Xe;let Ce;e[48]!==s||e[49]!==p||e[50]!==r?(Ce=be=>{p&&p({action:s,row:r,dir:be})},e[48]=s,e[49]=p,e[50]=r,e[51]=Ce):Ce=e[51];const Ye=Ce;let V;e[52]!==s||e[53]!==Le||e[54]!==R||e[55]!==r||e[56]!==N||e[57]!==W||e[58]!==O?(V=(be,Se)=>{const{left:ce,width:pe}=Se;if(P.current=!0,R){const{start:ue,end:he}=A.parserTransformToTime({left:ce,width:pe},{scaleWidth:W,scale:N,startLeft:O});if(R({action:s,row:r,start:ue,end:he,dir:be})===!1)return!1}Ue({left:ce,width:pe}),Le(ce,pe)},e[52]=s,e[53]=Le,e[54]=R,e[55]=r,e[56]=N,e[57]=W,e[58]=O,e[59]=V):V=e[59];const K=V;let X;e[60]!==t||e[61]!==I||e[62]!==v||e[63]!==r||e[64]!==N||e[65]!==W||e[66]!==O||e[67]!==C?(X=(be,Se)=>{const{left:ce,width:pe}=Se,{start:ue,end:he}=A.parserTransformToTime({left:ce,width:pe},{scaleWidth:W,scale:N,startLeft:O}),Ke=t.find(Gt=>Gt.id===r.id);if(!Ke)return;const Je=Ke.actions.find(Gt=>Gt.id===I);Je&&(Je.start=ue,Je.end=he,C(t),v&&v({action:Je,row:r,start:ue,end:he,dir:be}),Ue(null))},e[60]=t,e[61]=I,e[62]=v,e[63]=r,e[64]=N,e[65]=W,e[66]=O,e[67]=C,e[68]=X):X=e[68];const Y=X;let me,ae,G,oe,F,le,ie,de,Te,st,ot,it,ct,at,lt,ut,Ge,qe,ft,dt,ht,mt,pt,gt,vt,bt;if(e[69]!==s||e[70]!==$e||e[71]!==f||e[72]!==k||e[73]!==te||e[74]!==Ve||e[75]!==m||e[76]!==Be||e[77]!==De||e[78]!==Ze||e[79]!==Y||e[80]!==Ye||e[81]!==K||e[82]!==B||e[83]!==Ee||e[84]!==U||e[85]!==z||e[86]!==D||e[87]!==H||e[88]!==j||e[89]!==Pe||e[90]!==r||e[91]!==i||e[92]!==N||e[93]!==W||e[94]!==O||e[95]!==re||e[96]!==E.assistPositions||e[97]!==ye.left||e[98]!==ye.width){const be={...s,...A.parserTransformToTime({left:ye.left,width:ye.width},{startLeft:O,scaleWidth:W,scale:N})},Se={...r,actions:[...r.actions]};r.actions.includes(s)&&(Se.actions[r.actions.indexOf(s)]=be),me=cr,Te=q,st=re,ot=O,it=ye.left,ct=ye.width,at=m&&Ve||A.DEFAULT_MOVE_GRID,lt=m?Math.max((Ve||A.DEFAULT_MOVE_GRID)/2,A.DEFAULT_SNAP_DISTANCE):A.DEFAULT_SNAP_DISTANCE,ut=E.assistPositions,e[125]!==Ee||e[126]!==Pe?(Ge=()=>({left:Ee,right:Pe}),e[125]=Ee,e[126]=Pe,e[127]=Ge):Ge=e[127];let ce;e[128]!==f||e[129]!==k?(ce=!f&&k&&`.${ge("action-left-stretch")}`,e[128]=f,e[129]=k,e[130]=ce):ce=e[130];let pe;e[131]!==f||e[132]!==k?(pe=!f&&k&&`.${ge("action-right-stretch")}`,e[131]=f,e[132]=k,e[133]=pe):pe=e[133],e[134]!==ce||e[135]!==pe?(qe={left:ce,right:pe},e[134]=ce,e[135]=pe,e[136]=qe):qe=e[136],ft=!f&&U,dt=!f&&k,ht=Ze,mt=Be,pt=De,gt=Ye,vt=K,bt=Y,e[137]===Symbol.for("react.memo_cache_sentinel")?(ae=()=>{P.current=!1},e[137]=ae):ae=e[137],e[138]!==s||e[139]!==B||e[140]!==z||e[141]!==D||e[142]!==r?(G=ue=>{let he;z&&(he=B(ue),z(ue,{row:r,action:s,time:he})),!P.current&&D&&(he===void 0&&(he=B(ue)),D(ue,{row:r,action:s,time:he}))},e[138]=s,e[139]=B,e[140]=z,e[141]=D,e[142]=r,e[143]=G):G=e[143],e[144]!==s||e[145]!==B||e[146]!==j||e[147]!==r?(oe=ue=>{if(j){const he=B(ue);j(ue,{row:r,action:s,time:he})}},e[144]=s,e[145]=B,e[146]=j,e[147]=r,e[148]=oe):oe=e[148],e[149]!==s||e[150]!==B||e[151]!==H||e[152]!==r?(F=ue=>{if(H){const he=B(ue);H(ue,{row:r,action:s,time:he})}},e[149]=s,e[150]=B,e[151]=H,e[152]=r,e[153]=F):F=e[153],le=$e,e[154]!==i?(ie={height:i},e[154]=i,e[155]=ie):ie=e[155],de=te&&te(be,Se),e[69]=s,e[70]=$e,e[71]=f,e[72]=k,e[73]=te,e[74]=Ve,e[75]=m,e[76]=Be,e[77]=De,e[78]=Ze,e[79]=Y,e[80]=Ye,e[81]=K,e[82]=B,e[83]=Ee,e[84]=U,e[85]=z,e[86]=D,e[87]=H,e[88]=j,e[89]=Pe,e[90]=r,e[91]=i,e[92]=N,e[93]=W,e[94]=O,e[95]=re,e[96]=E.assistPositions,e[97]=ye.left,e[98]=ye.width,e[99]=me,e[100]=ae,e[101]=G,e[102]=oe,e[103]=F,e[104]=le,e[105]=ie,e[106]=de,e[107]=Te,e[108]=st,e[109]=ot,e[110]=it,e[111]=ct,e[112]=at,e[113]=lt,e[114]=ut,e[115]=Ge,e[116]=qe,e[117]=ft,e[118]=dt,e[119]=ht,e[120]=mt,e[121]=pt,e[122]=gt,e[123]=vt,e[124]=bt}else me=e[99],ae=e[100],G=e[101],oe=e[102],F=e[103],le=e[104],ie=e[105],de=e[106],Te=e[107],st=e[108],ot=e[109],it=e[110],ct=e[111],at=e[112],lt=e[113],ut=e[114],Ge=e[115],qe=e[116],ft=e[117],dt=e[118],ht=e[119],mt=e[120],pt=e[121],gt=e[122],vt=e[123],bt=e[124];let St;e[156]!==k?(St=k&&T.jsx("div",{className:ge("action-left-stretch"),style:{touchAction:"none"}}),e[156]=k,e[157]=St):St=e[157];let _t;e[158]!==k?(_t=k&&T.jsx("div",{className:ge("action-right-stretch"),style:{touchAction:"none"}}),e[158]=k,e[159]=_t):_t=e[159];let wt;e[160]!==ae||e[161]!==G||e[162]!==oe||e[163]!==F||e[164]!==le||e[165]!==ie||e[166]!==de||e[167]!==St||e[168]!==_t?(wt=T.jsxs("div",{onMouseDown:ae,onClick:G,onDoubleClick:oe,onContextMenu:F,className:le,style:ie,children:[de,St,_t]}),e[160]=ae,e[161]=G,e[162]=oe,e[163]=F,e[164]=le,e[165]=ie,e[166]=de,e[167]=St,e[168]=_t,e[169]=wt):wt=e[169];let Mt;return e[170]!==me||e[171]!==Te||e[172]!==st||e[173]!==ot||e[174]!==it||e[175]!==ct||e[176]!==at||e[177]!==lt||e[178]!==ut||e[179]!==Ge||e[180]!==qe||e[181]!==ft||e[182]!==dt||e[183]!==ht||e[184]!==mt||e[185]!==pt||e[186]!==gt||e[187]!==vt||e[188]!==bt||e[189]!==wt?(Mt=T.jsx(me,{ref:Te,parentRef:st,start:ot,left:it,width:ct,grid:at,snapDistance:lt,snapPositions:ut,getBounds:Ge,edges:qe,enableDragging:ft,enableResizing:dt,onDragStart:ht,onDrag:mt,onDragEnd:pt,onResizeStart:gt,onResize:vt,onResizeEnd:bt,children:wt}),e[170]=me,e[171]=Te,e[172]=st,e[173]=ot,e[174]=it,e[175]=ct,e[176]=at,e[177]=lt,e[178]=ut,e[179]=Ge,e[180]=qe,e[181]=ft,e[182]=dt,e[183]=ht,e[184]=mt,e[185]=pt,e[186]=gt,e[187]=vt,e[188]=bt,e[189]=wt,e[190]=Mt):Mt=e[190],Mt};function yt(n,e,t){let r=t.initialDeps??[],s;function o(){var i,c,a,u;let l;t.key&&((i=t.debug)!=null&&i.call(t))&&(l=Date.now());const m=n();if(!(m.length!==r.length||m.some((w,S)=>r[S]!==w)))return s;r=m;let g;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(g=Date.now()),s=e(...m),t.key&&((a=t.debug)!=null&&a.call(t))){const w=Math.round((Date.now()-l)*100)/100,S=Math.round((Date.now()-g)*100)/100,y=S/16,_=(h,p)=>{for(h=String(h);h.length<p;)h=" "+h;return h};console.info(`%c⏱ ${_(S,5)} /${_(w,5)} ms`,`
10
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),t.useMemoCache(e)}})()),nn}var _n;function Dr(){return _n||(_n=1,process.env.NODE_ENV==="production"?Ut.exports=Ar():Ut.exports=Cr()),Ut.exports}var De=Dr();function Pr(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.map(function(r){return r.split(" ").map(function(s){return s?""+n+s:""}).join(" ")}).join(" ")}function ve(...n){return Pr(`${D.PREFIX}-`,...n)}const Lr=n=>{const e=De.c(11),{isMoving:t,movePositions:r,assistPositions:s}=n;let o,i;if(e[0]!==t||e[1]!==r||e[2]!==s){const c=r===void 0?[]:r;let u;e[5]!==s?(u=s===void 0?[]:s,e[5]=s,e[6]=u):u=e[6];const l=u;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=ve("snap-line-container"),e[7]=o):o=e[7],i=t&&c.filter(m=>l.includes(m)).map(Or),e[0]=t,e[1]=r,e[2]=s,e[3]=o,e[4]=i}else o=e[3],i=e[4];let a;return e[8]!==o||e[9]!==i?(a=C.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=a):a=e[10],a};function Or(n,e){return C.jsx("div",{className:ve("snap-line"),style:{left:n}},e)}const Mr=1,Ir=10,wn=10;function Nr(n,e,t){const r=De.c(15),s=e===void 0?Mr:e,o=t===void 0?Ir:t,i=O.useRef(Number.MIN_SAFE_INTEGER),a=O.useRef(Number.MAX_SAFE_INTEGER),c=O.useRef(s),u=O.useRef(void 0);let l;r[0]!==n?(l=()=>{if(n?.current){const{left:h,width:v}=n.current.getBoundingClientRect();i.current=h,a.current=h+v}},r[0]=n,r[1]=l):l=r[1];const m=l;let f;r[2]!==o||r[3]!==s?(f=(h,v)=>{if(h.clientX>=a.current||h.clientX<=i.current){u.current!==void 0&&cancelAnimationFrame(u.current);const R=Math.abs(h.clientX>=a.current?h.clientX-a.current:h.clientX-i.current);c.current=Math.min(Number((R/wn).toFixed(0))*s,o);const P=(h.clientX>=a.current?1:-1)*c.current,M=()=>{v&&v(P),u.current=requestAnimationFrame(M)};return u.current=requestAnimationFrame(M),!1}else u.current!==void 0&&cancelAnimationFrame(u.current);return!0},r[2]=o,r[3]=s,r[4]=f):f=r[4];const p=f;let S;r[5]!==o||r[6]!==s?(S=(h,v,R)=>{if(h.clientX>=a.current||h.clientX<i.current){u.current!==void 0&&cancelAnimationFrame(u.current);const y=Math.abs(h.clientX>=a.current?h.clientX-a.current:h.clientX-i.current);c.current=Math.min(Number((y/wn).toFixed(0))*s,o);const M=(h.clientX>=a.current?1:-1)*c.current,x=()=>{R&&R(M),u.current=requestAnimationFrame(x)};return u.current=requestAnimationFrame(x),!1}else u.current!==void 0&&cancelAnimationFrame(u.current);return!0},r[5]=o,r[6]=s,r[7]=S):S=r[7];const _=S;let T;r[8]!==s?(T=()=>{i.current=Number.MIN_SAFE_INTEGER,a.current=Number.MAX_SAFE_INTEGER,c.current=s,u.current!==void 0&&cancelAnimationFrame(u.current)},r[8]=s,r[9]=T):T=r[9];const w=T;let b;return r[10]!==p||r[11]!==_||r[12]!==m||r[13]!==w?(b={initAutoScroll:m,dealDragAutoScroll:p,dealResizeAutoScroll:_,stopAutoScroll:w},r[10]=p,r[11]=_,r[12]=m,r[13]=w,r[14]=b):b=r[14],b}function kr(n,e,t){return Math.max(e,Math.min(n,t))}const be={toVector(n,e){return n===void 0&&(n=e),Array.isArray(n)?n:[n,n]},add(n,e){return[n[0]+e[0],n[1]+e[1]]},sub(n,e){return[n[0]-e[0],n[1]-e[1]]},addTo(n,e){n[0]+=e[0],n[1]+=e[1]},subTo(n,e){n[0]-=e[0],n[1]-=e[1]}};function En(n,e,t){return e===0||Math.abs(e)===1/0?Math.pow(n,t*5):n*e*t/(e+t*n)}function yn(n,e,t,r=.15){return r===0?kr(n,e,t):n<e?-En(e-n,t-e,r)+e:n>t?+En(n-t,t-e,r)+t:n}function Wr(n,[e,t],[r,s]){const[[o,i],[a,c]]=n;return[yn(e,o,i,r),yn(t,a,c,s)]}function zr(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function jr(n){var e=zr(n,"string");return typeof e=="symbol"?e:String(e)}function Ee(n,e,t){return e=jr(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Tn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function re(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tn(Object(t),!0).forEach(function(r){Ee(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Tn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const Hn={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function Rn(n){return n?n[0].toUpperCase()+n.slice(1):""}const Fr=["enter","leave"];function Ur(n=!1,e){return n&&!Fr.includes(e)}function Vr(n,e="",t=!1){const r=Hn[n],s=r&&r[e]||e;return"on"+Rn(n)+Rn(s)+(Ur(t,s)?"Capture":"")}const $r=["gotpointercapture","lostpointercapture"];function Hr(n){let e=n.substring(2).toLowerCase();const t=!!~e.indexOf("passive");t&&(e=e.replace("passive",""));const r=$r.includes(e)?"capturecapture":"capture",s=!!~e.indexOf(r);return s&&(e=e.replace("capture","")),{device:e,capture:s,passive:t}}function Br(n,e=""){const t=Hn[n],r=t&&t[e]||e;return n+r}function Gt(n){return"touches"in n}function Bn(n){return Gt(n)?"touch":"pointerType"in n?n.pointerType:"mouse"}function Xr(n){return Array.from(n.touches).filter(e=>{var t,r;return e.target===n.currentTarget||((t=n.currentTarget)===null||t===void 0||(r=t.contains)===null||r===void 0?void 0:r.call(t,e.target))})}function Yr(n){return n.type==="touchend"||n.type==="touchcancel"?n.changedTouches:n.targetTouches}function Xn(n){return Gt(n)?Yr(n)[0]:n}function qr(n){return Xr(n).map(e=>e.identifier)}function rn(n){const e=Xn(n);return Gt(n)?e.identifier:e.pointerId}function xn(n){const e=Xn(n);return[e.clientX,e.clientY]}function Kr(n){const e={};if("buttons"in n&&(e.buttons=n.buttons),"shiftKey"in n){const{shiftKey:t,altKey:r,metaKey:s,ctrlKey:o}=n;Object.assign(e,{shiftKey:t,altKey:r,metaKey:s,ctrlKey:o})}return e}function Yt(n,...e){return typeof n=="function"?n(...e):n}function Gr(){}function Jr(...n){return n.length===0?Gr:n.length===1?n[0]:function(){let e;for(const t of n)e=t.apply(this,arguments)||e;return e}}function An(n,e){return Object.assign({},e,n||{})}const Zr=32;class Qr{constructor(e,t,r){this.ctrl=e,this.args=t,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:r,args:s}=this;t[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=s,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,r=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=r.from?Yt(r.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:r,shared:s}=this;t.args=this.args;let o=0;if(e&&(t.event=e,r.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,s.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,s.locked=!!document.pointerLockElement,Object.assign(s,Kr(e)),s.down=s.pressed=s.buttons%2===1||s.touches>0,o=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const y=t._delta.map(Math.abs);be.addTo(t._distance,y)}this.axisIntent&&this.axisIntent(e);const[i,a]=t._movement,[c,u]=r.threshold,{_step:l,values:m}=t;if(r.hasCustomTransform?(l[0]===!1&&(l[0]=Math.abs(i)>=c&&m[0]),l[1]===!1&&(l[1]=Math.abs(a)>=u&&m[1])):(l[0]===!1&&(l[0]=Math.abs(i)>=c&&Math.sign(i)*c),l[1]===!1&&(l[1]=Math.abs(a)>=u&&Math.sign(a)*u)),t.intentional=l[0]!==!1||l[1]!==!1,!t.intentional)return;const f=[0,0];if(r.hasCustomTransform){const[y,P]=m;f[0]=l[0]!==!1?y-l[0]:0,f[1]=l[1]!==!1?P-l[1]:0}else f[0]=l[0]!==!1?i-l[0]:0,f[1]=l[1]!==!1?a-l[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(f);const p=t.offset,S=t._active&&!t._blocked||t.active;S&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=s[this.ingKey]=t._active,e&&(t.first&&("bounds"in r&&(t._bounds=Yt(r.bounds,t)),this.setup&&this.setup()),t.movement=f,this.computeOffset()));const[_,T]=t.offset,[[w,b],[h,v]]=t._bounds;t.overflow=[_<w?-1:_>b?1:0,T<h?-1:T>v?1:0],t._movementBound[0]=t.overflow[0]?t._movementBound[0]===!1?t._movement[0]:t._movementBound[0]:!1,t._movementBound[1]=t.overflow[1]?t._movementBound[1]===!1?t._movement[1]:t._movementBound[1]:!1;const R=t._active?r.rubberband||[0,0]:[0,0];if(t.offset=Wr(t._bounds,t.offset,R),t.delta=be.sub(t.offset,p),this.computeMovement(),S&&(!t.last||o>Zr)){t.delta=be.sub(t.offset,p);const y=t.delta.map(Math.abs);be.addTo(t.distance,y),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&o>0&&(t.velocity=[y[0]/o,y[1]/o],t.timeDelta=o)}}emit(){const e=this.state,t=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const s=this.handler(re(re(re({},t),e),{},{[this.aliasKey]:e.values}));s!==void 0&&(e.memo=s)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function es([n,e],t){const r=Math.abs(n),s=Math.abs(e);if(r>s&&r>t)return"x";if(s>r&&s>t)return"y"}class ts extends Qr{constructor(...e){super(...e),Ee(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=be.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=be.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,r=this.config;if(!t.axis&&e){const s=typeof r.axisThreshold=="object"?r.axisThreshold[Bn(e)]:r.axisThreshold;t.axis=es(t._movement,s)}t._blocked=(r.lockDirection||!!r.axis)&&!t.axis||!!r.axis&&r.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const Cn=n=>n,Dn=.15,un={enabled(n=!0){return n},eventOptions(n,e,t){return re(re({},t.shared.eventOptions),n)},preventDefault(n=!1){return n},triggerAllEvents(n=!1){return n},rubberband(n=0){switch(n){case!0:return[Dn,Dn];case!1:return[0,0];default:return be.toVector(n)}},from(n){if(typeof n=="function")return n;if(n!=null)return be.toVector(n)},transform(n,e,t){const r=n||t.shared.transform;if(this.hasCustomTransform=!!r,process.env.NODE_ENV==="development"){const s=r||Cn;return o=>{const i=s(o);return(!isFinite(i[0])||!isFinite(i[1]))&&console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${i[0]},${[1]}]`),i}}return r||Cn},threshold(n){return be.toVector(n,0)}};process.env.NODE_ENV==="development"&&Object.assign(un,{domTarget(n){if(n!==void 0)throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");return NaN},lockDirection(n){if(n!==void 0)throw Error("[@use-gesture]: `lockDirection` option has been merged with `axis`. Use it as in `{ axis: 'lock' }`");return NaN},initial(n){if(n!==void 0)throw Error("[@use-gesture]: `initial` option has been renamed to `from`.");return NaN}});const ns=0,Nt=re(re({},un),{},{axis(n,e,{axis:t}){if(this.lockDirection=t==="lock",!this.lockDirection)return t},axisThreshold(n=ns){return n},bounds(n={}){if(typeof n=="function")return o=>Nt.bounds(n(o));if("current"in n)return()=>n.current;if(typeof HTMLElement=="function"&&n instanceof HTMLElement)return n;const{left:e=-1/0,right:t=1/0,top:r=-1/0,bottom:s=1/0}=n;return[[e,t],[r,s]]}}),Pn={ArrowRight:(n,e=1)=>[n*e,0],ArrowLeft:(n,e=1)=>[-1*n*e,0],ArrowUp:(n,e=1)=>[0,-1*n*e],ArrowDown:(n,e=1)=>[0,n*e]};class rs extends ts{constructor(...e){super(...e),Ee(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),s={left:t.left-r.left+e.offset[0],right:t.right-r.right+e.offset[0],top:t.top-r.top+e.offset[1],bottom:t.bottom-r.bottom+e.offset[1]};e._bounds=Nt.bounds(s)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,r=this.state;if(e.buttons!=null&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):t.pointerButtons!==-1&&t.pointerButtons!==e.buttons))return;const s=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(s&&s.size>1&&r._pointerActive)&&(this.start(e),this.setupPointer(e),r._pointerId=rn(e),r._pointerActive=!0,this.computeValues(xn(e)),this.computeInitial(),t.preventScrollAxis&&Bn(e)!=="mouse"?(r._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,r=this.config;if(!t._pointerActive)return;const s=rn(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;const o=xn(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=be.sub(o,t._values),this.computeValues(o)),be.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(r.preventScrollAxis&&!t._preventScroll)if(t.axis)if(t.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{process.env.NODE_ENV==="development"&&console.warn("[@use-gesture]: If you see this message, it's likely that you're using an outdated version of `@react-three/fiber`. \n\nPlease upgrade to the latest version.")}const t=this.state,r=this.config;if(!t._active||!t._pointerActive)return;const s=rn(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[o,i]=t._distance;if(t.tap=o<=r.tapsThreshold&&i<=r.tapsThreshold,t.tap&&r.filterTaps)t._force=!0;else{const[a,c]=t._delta,[u,l]=t._movement,[m,f]=r.swipe.velocity,[p,S]=r.swipe.distance,_=r.swipe.duration;if(t.elapsedTime<_){const T=Math.abs(a/t.timeDelta),w=Math.abs(c/t.timeDelta);T>m&&Math.abs(u)>p&&(t.swipe[0]=Math.sign(a)),w>f&&Math.abs(l)>S&&(t.swipe[1]=Math.sign(c))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,r=t.device;if(process.env.NODE_ENV==="development")try{if(r==="pointer"&&t.preventScrollDelay===void 0){const s="uv"in e?e.sourceEvent.currentTarget:e.currentTarget;window.getComputedStyle(s).touchAction==="auto"&&console.warn("[@use-gesture]: The drag target has its `touch-action` style property set to `auto`. It is recommended to add `touch-action: 'none'` so that the drag gesture behaves correctly on touch-enabled devices. For more information read this: https://use-gesture.netlify.app/docs/extras/#touch-action.\n\nThis message will only show in development mode. It won't appear in production. If this is intended, you can ignore it.",s)}}catch{}t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,ss(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=Pn[e.key];if(t){const r=this.state,s=e.shiftKey?10:e.altKey?.1:1;this.start(e),r._delta=t(this.config.keyboardDisplacement,s),r._keyboardActive=!0,be.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in Pn&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function ss(n){"persist"in n&&typeof n.persist=="function"&&n.persist()}const kt=typeof window<"u"&&window.document&&window.document.createElement;function Yn(){return kt&&"ontouchstart"in window}function os(){return Yn()||kt&&window.navigator.maxTouchPoints>1}function is(){return kt&&"onpointerdown"in window}function as(){return kt&&"exitPointerLock"in window.document}function cs(){try{return"constructor"in GestureEvent}catch{return!1}}const Re={isBrowser:kt,gesture:cs(),touch:Yn(),touchscreen:os(),pointer:is(),pointerLock:as()},ls=250,us=180,fs=.5,ds=50,hs=250,ms=10,Ln={mouse:0,touch:0,pen:8},qn=re(re({},Nt),{},{device(n,e,{pointer:{touch:t=!1,lock:r=!1,mouse:s=!1}={}}){return this.pointerLock=r&&Re.pointerLock,Re.touch&&t?"touch":this.pointerLock?"mouse":Re.pointer&&!s?"pointer":Re.touch?"touch":"mouse"},preventScrollAxis(n,e,{preventScroll:t}){if(this.preventScrollDelay=typeof t=="number"?t:t||t===void 0&&n?ls:void 0,!(!Re.touchscreen||t===!1))return n||(t!==void 0?"y":void 0)},pointerCapture(n,e,{pointer:{capture:t=!0,buttons:r=1,keys:s=!0}={}}){return this.pointerButtons=r,this.keys=s,!this.pointerLock&&this.device==="pointer"&&t},threshold(n,e,{filterTaps:t=!1,tapsThreshold:r=3,axis:s=void 0}){const o=be.toVector(n,t?r:s?1:0);return this.filterTaps=t,this.tapsThreshold=r,o},swipe({velocity:n=fs,distance:e=ds,duration:t=hs}={}){return{velocity:this.transform(be.toVector(n)),distance:this.transform(be.toVector(e)),duration:t}},delay(n=0){switch(n){case!0:return us;case!1:return 0;default:return n}},axisThreshold(n){return n?re(re({},Ln),n):Ln},keyboardDisplacement(n=ms){return n}});process.env.NODE_ENV==="development"&&Object.assign(qn,{useTouch(n){if(n!==void 0)throw Error("[@use-gesture]: `useTouch` option has been renamed to `pointer.touch`. Use it as in `{ pointer: { touch: true } }`.");return NaN},experimental_preventWindowScrollY(n){if(n!==void 0)throw Error("[@use-gesture]: `experimental_preventWindowScrollY` option has been renamed to `preventScroll`.");return NaN},swipeVelocity(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeVelocity` option has been renamed to `swipe.velocity`. Use it as in `{ swipe: { velocity: 0.5 } }`.");return NaN},swipeDistance(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeDistance` option has been renamed to `swipe.distance`. Use it as in `{ swipe: { distance: 50 } }`.");return NaN},swipeDuration(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeDuration` option has been renamed to `swipe.duration`. Use it as in `{ swipe: { duration: 250 } }`.");return NaN}});re(re({},un),{},{device(n,e,{shared:t,pointer:{touch:r=!1}={}}){if(t.target&&!Re.touch&&Re.gesture)return"gesture";if(Re.touch&&r)return"touch";if(Re.touchscreen){if(Re.pointer)return"pointer";if(Re.touch)return"touch"}},bounds(n,e,{scaleBounds:t={},angleBounds:r={}}){const s=i=>{const a=An(Yt(t,i),{min:-1/0,max:1/0});return[a.min,a.max]},o=i=>{const a=An(Yt(r,i),{min:-1/0,max:1/0});return[a.min,a.max]};return typeof t!="function"&&typeof r!="function"?[s(),o()]:i=>[s(i),o(i)]},threshold(n,e,t){return this.lockDirection=t.axis==="lock",be.toVector(n,this.lockDirection?[.1,3]:0)},modifierKey(n){return n===void 0?"ctrlKey":n},pinchOnWheel(n=!0){return n}});re(re({},Nt),{},{mouseOnly:(n=!0)=>n});re(re({},Nt),{},{mouseOnly:(n=!0)=>n});const Kn=new Map,cn=new Map;function ps(n){Kn.set(n.key,n.engine),cn.set(n.key,n.resolver)}const gs={key:"drag",engine:rs,resolver:qn};function vs(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o<r.length;o++)s=r[o],!(e.indexOf(s)>=0)&&(t[s]=n[s]);return t}function bs(n,e){if(n==null)return{};var t=vs(n,e),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}const Ss={target(n){if(n)return()=>"current"in n?n.current:n},enabled(n=!0){return n},window(n=Re.isBrowser?window:void 0){return n},eventOptions({passive:n=!0,capture:e=!1}={}){return{passive:n,capture:e}},transform(n){return n}},_s=["target","eventOptions","window","enabled","transform"];function $t(n={},e){const t={};for(const[r,s]of Object.entries(e))switch(typeof s){case"function":if(process.env.NODE_ENV==="development"){const o=s.call(t,n[r],r,n);Number.isNaN(o)||(t[r]=o)}else t[r]=s.call(t,n[r],r,n);break;case"object":t[r]=$t(n[r],s);break;case"boolean":s&&(t[r]=n[r]);break}return t}function ws(n,e,t={}){const r=n,{target:s,eventOptions:o,window:i,enabled:a,transform:c}=r,u=bs(r,_s);if(t.shared=$t({target:s,eventOptions:o,window:i,enabled:a,transform:c},Ss),e){const l=cn.get(e);t[e]=$t(re({shared:t.shared},u),l)}else for(const l in u){const m=cn.get(l);if(m)t[l]=$t(re({shared:t.shared},u[l]),m);else if(process.env.NODE_ENV==="development"&&!["drag","pinch","scroll","wheel","move","hover"].includes(l)){if(l==="domTarget")throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");console.warn(`[@use-gesture]: Unknown config key \`${l}\` was used. Please read the documentation for further information.`)}}return t}class Gn{constructor(e,t){Ee(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,r,s,o){const i=this._listeners,a=Br(t,r),c=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},u=re(re({},c),o);e.addEventListener(a,s,u);const l=()=>{e.removeEventListener(a,s,u),i.delete(l)};return i.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class Es{constructor(){Ee(this,"_timeouts",new Map)}add(e,t,r=140,...s){this.remove(e),this._timeouts.set(e,window.setTimeout(t,r,...s))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class ys{constructor(e){Ee(this,"gestures",new Set),Ee(this,"_targetEventStore",new Gn(this)),Ee(this,"gestureEventStores",{}),Ee(this,"gestureTimeoutStores",{}),Ee(this,"handlers",{}),Ee(this,"config",{}),Ee(this,"pointerIds",new Set),Ee(this,"touchIds",new Set),Ee(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),Ts(this,e)}setEventIds(e){if(Gt(e))return this.touchIds=new Set(qr(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=ws(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,r={};let s;if(!(t.target&&(s=t.target(),!s))){if(t.enabled){for(const i of this.gestures){const a=this.config[i],c=On(r,a.eventOptions,!!s);if(a.enabled){const u=Kn.get(i);new u(this,e,i).bind(c)}}const o=On(r,t.eventOptions,!!s);for(const i in this.nativeHandlers)o(i,"",a=>this.nativeHandlers[i](re(re({},this.state.shared),{},{event:a,args:e})),void 0,!0)}for(const o in r)r[o]=Jr(...r[o]);if(!s)return r;for(const o in r){const{device:i,capture:a,passive:c}=Hr(o);this._targetEventStore.add(s,i,"",r[o],{capture:a,passive:c})}}}}function Ct(n,e){n.gestures.add(e),n.gestureEventStores[e]=new Gn(n,e),n.gestureTimeoutStores[e]=new Es}function Ts(n,e){e.drag&&Ct(n,"drag"),e.wheel&&Ct(n,"wheel"),e.scroll&&Ct(n,"scroll"),e.move&&Ct(n,"move"),e.pinch&&Ct(n,"pinch"),e.hover&&Ct(n,"hover")}const On=(n,e,t)=>(r,s,o,i={},a=!1)=>{var c,u;const l=(c=i.capture)!==null&&c!==void 0?c:e.capture,m=(u=i.passive)!==null&&u!==void 0?u:e.passive;let f=a?r:Vr(r,s,l);t&&m&&(f+="Passive"),n[f]=n[f]||[],n[f].push(o)};function Rs(n,e={},t,r){const s=O.useMemo(()=>new ys(n),[]);if(s.applyHandlers(n,r),s.applyConfig(e,t),O.useEffect(s.effect.bind(s)),O.useEffect(()=>s.clean.bind(s),[]),e.target===void 0)return s.bind.bind(s)}function sn(n,e){return ps(gs),Rs({drag:n},e||{},"drag")}function Mn(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function Jn(...n){return e=>{let t=!1;const r=n.map(s=>{const o=Mn(s,e);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Mn(n[s],null)}}}}function ot(...n){return g.useCallback(Jn(...n),n)}function Zn(n){const e=As(n),t=g.forwardRef((r,s)=>{const{children:o,...i}=r,a=g.Children.toArray(o),c=a.find(Ds);if(c){const u=c.props.children,l=a.map(m=>m===c?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:m);return C.jsx(e,{...i,ref:s,children:g.isValidElement(u)?g.cloneElement(u,void 0,l):null})}return C.jsx(e,{...i,ref:s,children:o})});return t.displayName=`${n}.Slot`,t}var xs=Zn("Slot");function As(n){const e=g.forwardRef((t,r)=>{const{children:s,...o}=t;if(g.isValidElement(s)){const i=Ls(s),a=Ps(o,s.props);return s.type!==g.Fragment&&(a.ref=r?Jn(r,i):i),g.cloneElement(s,a)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var Cs=Symbol("radix.slottable");function Ds(n){return g.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===Cs}function Ps(n,e){const t={...e};for(const r in e){const s=n[r],o=e[r];/^on[A-Z]/.test(r)?s&&o?t[r]=(...a)=>{const c=o(...a);return s(...a),c}:s&&(t[r]=s):r==="style"?t[r]={...s,...o}:r==="className"&&(t[r]=[s,o].filter(Boolean).join(" "))}return{...n,...t}}function Ls(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var Os=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wt=Os.reduce((n,e)=>{const t=Zn(`Primitive.${e}`),r=g.forwardRef((s,o)=>{const{asChild:i,...a}=s,c=i?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(c,{...a,ref:o})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{});function Ms(n,e=[]){let t=[];function r(o,i){const a=g.createContext(i),c=t.length;t=[...t,i];const u=m=>{const{scope:f,children:p,...S}=m,_=f?.[n]?.[c]||a,T=g.useMemo(()=>S,Object.values(S));return C.jsx(_.Provider,{value:T,children:p})};u.displayName=o+"Provider";function l(m,f){const p=f?.[n]?.[c]||a,S=g.useContext(p);if(S)return S;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[u,l]}const s=()=>{const o=t.map(i=>g.createContext(i));return function(a){const c=a?.[n]||o;return g.useMemo(()=>({[`__scope${n}`]:{...a,[n]:c}}),[a,c])}};return s.scopeName=n,[r,Is(s,...e)]}function Is(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const m=c(o)[`__scope${u}`];return{...a,...m}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return t.scopeName=e.scopeName,t}function st(n,e,{checkForDefaultPrevented:t=!0}={}){return function(s){if(n?.(s),t===!1||!s.defaultPrevented)return e?.(s)}}var ln=globalThis?.document?g.useLayoutEffect:()=>{};function Ns(n,e){return g.useReducer((t,r)=>e[t][r]??t,n)}var zt=n=>{const{present:e,children:t}=n,r=ks(e),s=typeof t=="function"?t({present:r.isPresent}):g.Children.only(t),o=ot(r.ref,Ws(s));return typeof t=="function"||r.isPresent?g.cloneElement(s,{ref:o}):null};zt.displayName="Presence";function ks(n){const[e,t]=g.useState(),r=g.useRef(null),s=g.useRef(n),o=g.useRef("none"),i=n?"mounted":"unmounted",[a,c]=Ns(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=Vt(r.current);o.current=a==="mounted"?u:"none"},[a]),ln(()=>{const u=r.current,l=s.current;if(l!==n){const f=o.current,p=Vt(u);n?c("MOUNT"):p==="none"||u?.display==="none"?c("UNMOUNT"):c(l&&f!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=n}},[n,c]),ln(()=>{if(e){let u;const l=e.ownerDocument.defaultView??window,m=p=>{const _=Vt(r.current).includes(CSS.escape(p.animationName));if(p.target===e&&_&&(c("ANIMATION_END"),!s.current)){const T=e.style.animationFillMode;e.style.animationFillMode="forwards",u=l.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=T)})}},f=p=>{p.target===e&&(o.current=Vt(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{l.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(u=>{r.current=u?getComputedStyle(u):null,t(u)},[])}}function Vt(n){return n?.animationName||"none"}function Ws(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var zs=g.createContext(void 0);function js(n){const e=g.useContext(zs);return n||e||"ltr"}function rt(n){const e=g.useRef(n);return g.useEffect(()=>{e.current=n}),g.useMemo(()=>(...t)=>e.current?.(...t),[])}function Fs(n,[e,t]){return Math.min(t,Math.max(e,n))}function Us(n,e){return g.useReducer((t,r)=>e[t][r]??t,n)}var fn="ScrollArea",[Qn]=Ms(fn),[Vs,xe]=Qn(fn),er=g.forwardRef((n,e)=>{const{__scopeScrollArea:t,type:r="hover",dir:s,scrollHideDelay:o=600,...i}=n,[a,c]=g.useState(null),[u,l]=g.useState(null),[m,f]=g.useState(null),[p,S]=g.useState(null),[_,T]=g.useState(null),[w,b]=g.useState(0),[h,v]=g.useState(0),[R,y]=g.useState(!1),[P,M]=g.useState(!1),x=ot(e,W=>c(W)),E=js(s);return C.jsx(Vs,{scope:t,type:r,dir:E,scrollHideDelay:o,scrollArea:a,viewport:u,onViewportChange:l,content:m,onContentChange:f,scrollbarX:p,onScrollbarXChange:S,scrollbarXEnabled:R,onScrollbarXEnabledChange:y,scrollbarY:_,onScrollbarYChange:T,scrollbarYEnabled:P,onScrollbarYEnabledChange:M,onCornerWidthChange:b,onCornerHeightChange:v,children:C.jsx(Wt.div,{dir:E,...i,ref:x,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":h+"px",...n.style}})})});er.displayName=fn;var tr="ScrollAreaViewport",nr=g.forwardRef((n,e)=>{const{__scopeScrollArea:t,children:r,nonce:s,...o}=n,i=xe(tr,t),a=g.useRef(null),c=ot(e,a,i.onViewportChange);return C.jsxs(C.Fragment,{children:[C.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),C.jsx(Wt.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...n.style},children:C.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});nr.displayName=tr;var Me="ScrollAreaScrollbar",rr=g.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=xe(Me,n.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,a=n.orientation==="horizontal";return g.useEffect(()=>(a?o(!0):i(!0),()=>{a?o(!1):i(!1)}),[a,o,i]),s.type==="hover"?C.jsx($s,{...r,ref:e,forceMount:t}):s.type==="scroll"?C.jsx(Hs,{...r,ref:e,forceMount:t}):s.type==="auto"?C.jsx(sr,{...r,ref:e,forceMount:t}):s.type==="always"?C.jsx(dn,{...r,ref:e}):null});rr.displayName=Me;var $s=g.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=xe(Me,n.__scopeScrollArea),[o,i]=g.useState(!1);return g.useEffect(()=>{const a=s.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),i(!0)},l=()=>{c=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",l),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",l)}}},[s.scrollArea,s.scrollHideDelay]),C.jsx(zt,{present:t||o,children:C.jsx(sr,{"data-state":o?"visible":"hidden",...r,ref:e})})}),Hs=g.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=xe(Me,n.__scopeScrollArea),o=n.orientation==="horizontal",i=Zt(()=>c("SCROLL_END"),100),[a,c]=Us("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return g.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,s.scrollHideDelay,c]),g.useEffect(()=>{const u=s.viewport,l=o?"scrollLeft":"scrollTop";if(u){let m=u[l];const f=()=>{const p=u[l];m!==p&&(c("SCROLL"),i()),m=p};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[s.viewport,o,c,i]),C.jsx(zt,{present:t||a!=="hidden",children:C.jsx(dn,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:st(n.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:st(n.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),sr=g.forwardRef((n,e)=>{const t=xe(Me,n.__scopeScrollArea),{forceMount:r,...s}=n,[o,i]=g.useState(!1),a=n.orientation==="horizontal",c=Zt(()=>{if(t.viewport){const u=t.viewport.offsetWidth<t.viewport.scrollWidth,l=t.viewport.offsetHeight<t.viewport.scrollHeight;i(a?u:l)}},10);return Lt(t.viewport,c),Lt(t.content,c),C.jsx(zt,{present:r||o,children:C.jsx(dn,{"data-state":o?"visible":"hidden",...s,ref:e})})}),dn=g.forwardRef((n,e)=>{const{orientation:t="vertical",...r}=n,s=xe(Me,n.__scopeScrollArea),o=g.useRef(null),i=g.useRef(0),[a,c]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=lr(a.viewport,a.content),l={...r,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>o.current=f,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:f=>i.current=f};function m(f,p){return Gs(f,i.current,a,p)}return t==="horizontal"?C.jsx(Bs,{...l,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollLeft,p=In(f,a,s.dir);o.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollLeft=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollLeft=m(f,s.dir))}}):t==="vertical"?C.jsx(Xs,{...l,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollTop,p=In(f,a);o.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollTop=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollTop=m(f))}}):null}),Bs=g.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=xe(Me,n.__scopeScrollArea),[i,a]=g.useState(),c=g.useRef(null),u=ot(e,c,o.onScrollbarXChange);return g.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),C.jsx(ir,{"data-orientation":"horizontal",...s,ref:u,sizes:t,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Jt(t)+"px",...n.style},onThumbPointerDown:l=>n.onThumbPointerDown(l.x),onDragScroll:l=>n.onDragScroll(l.x),onWheelScroll:(l,m)=>{if(o.viewport){const f=o.viewport.scrollLeft+l.deltaX;n.onWheelScroll(f),fr(f,m)&&l.preventDefault()}},onResize:()=>{c.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Kt(i.paddingLeft),paddingEnd:Kt(i.paddingRight)}})}})}),Xs=g.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=xe(Me,n.__scopeScrollArea),[i,a]=g.useState(),c=g.useRef(null),u=ot(e,c,o.onScrollbarYChange);return g.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),C.jsx(ir,{"data-orientation":"vertical",...s,ref:u,sizes:t,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Jt(t)+"px",...n.style},onThumbPointerDown:l=>n.onThumbPointerDown(l.y),onDragScroll:l=>n.onDragScroll(l.y),onWheelScroll:(l,m)=>{if(o.viewport){const f=o.viewport.scrollTop+l.deltaY;n.onWheelScroll(f),fr(f,m)&&l.preventDefault()}},onResize:()=>{c.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Kt(i.paddingTop),paddingEnd:Kt(i.paddingBottom)}})}})}),[Ys,or]=Qn(Me),ir=g.forwardRef((n,e)=>{const{__scopeScrollArea:t,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:l,onResize:m,...f}=n,p=xe(Me,t),[S,_]=g.useState(null),T=ot(e,x=>_(x)),w=g.useRef(null),b=g.useRef(""),h=p.viewport,v=r.content-r.viewport,R=rt(l),y=rt(c),P=Zt(m,10);function M(x){if(w.current){const E=x.clientX-w.current.left,W=x.clientY-w.current.top;u({x:E,y:W})}}return g.useEffect(()=>{const x=E=>{const W=E.target;S?.contains(W)&&R(E,v)};return document.addEventListener("wheel",x,{passive:!1}),()=>document.removeEventListener("wheel",x,{passive:!1})},[h,S,v,R]),g.useEffect(y,[r,y]),Lt(S,P),Lt(p.content,P),C.jsx(Ys,{scope:t,scrollbar:S,hasThumb:s,onThumbChange:rt(o),onThumbPointerUp:rt(i),onThumbPositionChange:y,onThumbPointerDown:rt(a),children:C.jsx(Wt.div,{...f,ref:T,style:{position:"absolute",...f.style},onPointerDown:st(n.onPointerDown,x=>{x.button===0&&(x.target.setPointerCapture(x.pointerId),w.current=S.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),M(x))}),onPointerMove:st(n.onPointerMove,M),onPointerUp:st(n.onPointerUp,x=>{const E=x.target;E.hasPointerCapture(x.pointerId)&&E.releasePointerCapture(x.pointerId),document.body.style.webkitUserSelect=b.current,p.viewport&&(p.viewport.style.scrollBehavior=""),w.current=null})})})}),qt="ScrollAreaThumb",ar=g.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=or(qt,n.__scopeScrollArea);return C.jsx(zt,{present:t||s.hasThumb,children:C.jsx(qs,{ref:e,...r})})}),qs=g.forwardRef((n,e)=>{const{__scopeScrollArea:t,style:r,...s}=n,o=xe(qt,t),i=or(qt,t),{onThumbPositionChange:a}=i,c=ot(e,m=>i.onThumbChange(m)),u=g.useRef(void 0),l=Zt(()=>{u.current&&(u.current(),u.current=void 0)},100);return g.useEffect(()=>{const m=o.viewport;if(m){const f=()=>{if(l(),!u.current){const p=Js(m,a);u.current=p,a()}};return a(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[o.viewport,l,a]),C.jsx(Wt.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:st(n.onPointerDownCapture,m=>{const p=m.target.getBoundingClientRect(),S=m.clientX-p.left,_=m.clientY-p.top;i.onThumbPointerDown({x:S,y:_})}),onPointerUp:st(n.onPointerUp,i.onThumbPointerUp)})});ar.displayName=qt;var hn="ScrollAreaCorner",cr=g.forwardRef((n,e)=>{const t=xe(hn,n.__scopeScrollArea),r=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&r?C.jsx(Ks,{...n,ref:e}):null});cr.displayName=hn;var Ks=g.forwardRef((n,e)=>{const{__scopeScrollArea:t,...r}=n,s=xe(hn,t),[o,i]=g.useState(0),[a,c]=g.useState(0),u=!!(o&&a);return Lt(s.scrollbarX,()=>{const l=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(l),c(l)}),Lt(s.scrollbarY,()=>{const l=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(l),i(l)}),u?C.jsx(Wt.div,{...r,ref:e,style:{width:o,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null});function Kt(n){return n?parseInt(n,10):0}function lr(n,e){const t=n/e;return isNaN(t)?0:t}function Jt(n){const e=lr(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}function Gs(n,e,t,r="ltr"){const s=Jt(t),o=s/2,i=e||o,a=s-i,c=t.scrollbar.paddingStart+i,u=t.scrollbar.size-t.scrollbar.paddingEnd-a,l=t.content-t.viewport,m=r==="ltr"?[0,l]:[l*-1,0];return ur([c,u],m)(n)}function In(n,e,t="ltr"){const r=Jt(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-s,i=e.content-e.viewport,a=o-r,c=t==="ltr"?[0,i]:[i*-1,0],u=Fs(n,c);return ur([0,i],[0,a])(u)}function ur(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function fr(n,e){return n>0&&n<e}var Js=(n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},r=0;return(function s(){const o={left:n.scrollLeft,top:n.scrollTop},i=t.left!==o.left,a=t.top!==o.top;(i||a)&&e(),t=o,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function Zt(n,e){const t=rt(n),r=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),g.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}function Lt(n,e){const t=rt(e);ln(()=>{let r=0;if(n){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)});return s.observe(n),()=>{window.cancelAnimationFrame(r),s.unobserve(n)}}},[n,t])}var Zs=er,Qs=nr,eo=cr;const on=(n,e,t,r,s)=>({target:n,dx:e[0],dy:e[1],clientX:t[0],clientY:t[1],...r&&{edges:r},...s&&{deltaRect:s}}),to=(n,e,t)=>n?n===e||n===t||(e?.contains(n)??!1)||(t?.contains(n)??!1):!1,no=n=>{const e=De.c(34),{children:t,style:r,draggable:s,resizable:o,draggableOptions:i,resizableOptions:a,ref:c}=n,u=O.useRef(void 0),l=O.useRef(void 0),m=O.useRef(null),f=O.useRef(null),p=O.useRef(void 0),S=O.useRef(void 0);let _,T;e[0]!==i||e[1]!==c||e[2]!==a?(_=()=>{if(u.current=i,l.current=a,!c?.current)return;const k=a?.edges?.left,Y=a?.edges?.right;k&&k!==p.current&&(p.current=k,m.current=c.current.querySelector(k)),Y&&Y!==S.current&&(S.current=Y,f.current=c.current.querySelector(Y))},T=[i,c,a],e[0]=i,e[1]=c,e[2]=a,e[3]=_,e[4]=T):(_=e[3],T=e[4]),O.useEffect(_,T);let w;e[5]!==c?(w=k=>{const{active:Y,delta:Q,xy:j,event:I,first:d,last:A}=k,L=c?.current;if(!L||to(I?.target,m.current,f.current))return;const F=on(L,Q,j);d?u.current?.onstart?.(F):A?u.current?.onend?.(F):Y&&u.current?.onmove?.(F)},e[5]=c,e[6]=w):w=e[6];const b=i?.lockAxis==="x"?"x":void 0;let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h={capture:!0},e[7]=h):h=e[7];let v;e[8]!==s||e[9]!==c||e[10]!==b?(v={enabled:s,axis:b,pointer:h,target:c,threshold:0},e[8]=s,e[9]=c,e[10]=b,e[11]=v):v=e[11],sn(w,v);let R;e[12]!==c?(R=k=>{const{active:Y,delta:Q,xy:j,first:I,last:d}=k,A=c?.current;if(!A)return;const L=on(A,Q,j,{left:!0},{left:Q[0]});I?l.current?.onstart?.(L):d?l.current?.onend?.(L):Y&&l.current?.onmove?.(L)},e[12]=c,e[13]=R):R=e[13];let y;e[14]===Symbol.for("react.memo_cache_sentinel")?(y={capture:!0},e[14]=y):y=e[14];let P;e[15]!==o?(P={enabled:o,target:m,pointer:y,threshold:0},e[15]=o,e[16]=P):P=e[16],sn(R,P);let M;e[17]!==c?(M=k=>{const{active:Y,delta:Q,xy:j,first:I,last:d}=k,A=c?.current;if(!A)return;const L=on(A,Q,j,{right:!0},{right:Q[0]});I?l.current?.onstart?.(L):d?l.current?.onend?.(L):Y&&l.current?.onmove?.(L)},e[17]=c,e[18]=M):M=e[18];let x;e[19]===Symbol.for("react.memo_cache_sentinel")?(x={capture:!0},e[19]=x):x=e[19];let E;e[20]!==o?(E={enabled:o,target:f,pointer:x,threshold:0},e[20]=o,e[21]=E):E=e[21],sn(M,E);let W,J;e[22]!==c?(W=()=>{const k=c?.current;if(!k)return;const Y=l.current?.edges?.left,Q=l.current?.edges?.right;Y&&(m.current=k.querySelector(Y)),Q&&(f.current=k.querySelector(Q))},J=[c],e[22]=c,e[23]=W,e[24]=J):(W=e[23],J=e[24]),O.useLayoutEffect(W,J);let Z;e[25]!==s?(Z=s?{touchAction:"none"}:{},e[25]=s,e[26]=Z):Z=e[26];let K;e[27]!==r||e[28]!==Z?(K={...Z,...r},e[27]=r,e[28]=Z,e[29]=K):K=e[29];let ie;return e[30]!==t||e[31]!==c||e[32]!==K?(ie=C.jsx(xs,{ref:c,style:K,draggable:!1,children:t}),e[30]=t,e[31]=c,e[32]=K,e[33]=ie):ie=e[33],ie},Nn=tt.getLogger("[Snap Debug]").setLevel("info"),we=(n,e=0)=>n?parseFloat(n):e,an=(n,e,t,r=Number.MAX_SAFE_INTEGER)=>{let s=n,o=r;for(const i of e){const a=typeof i=="number"?i:i.value,c=Math.abs(a-n);c<t&&c<o&&(s=a,o=c,typeof i=="object"?Nn.debug(`Snapped to: ${a} (Distance: ${c}) Row: ${i.rowId??"N/A"} Action: ${i.actionId??"N/A"}`):Nn.debug(`Snapped to: ${a} (Distance: ${c})`))}return{snap:s,minDis:o}};function dr(n){const e=De.c(70),{children:t,edges:r,left:s,width:o,start:i,grid:a,getBounds:c,enableResizing:u,enableDragging:l,snapDistance:m,snapPositions:f,snapOrigin:p,onResizeStart:S,onResize:_,onResizeEnd:T,onDragStart:w,onDragEnd:b,onDrag:h,parentRef:v,autoScroll:R,autoScrollSpeed:y,autoScrollMaxSpeed:P,ref:M}=n,x=i===void 0?D.DEFAULT_START_LEFT:i,E=a===void 0?D.DEFAULT_MOVE_GRID:a,W=c===void 0?so:c,J=u===void 0?!0:u,Z=l===void 0?!0:l,K=m===void 0?D.DEFAULT_SNAP_DISTANCE:m;let ie;e[0]!==f?(ie=f===void 0?[]:f,e[0]=f,e[1]=ie):ie=e[1];const k=ie,Y=p===void 0?"leading":p,Q=R===void 0?!0:R,j=O.useRef(null),I=O.useRef(0),d=O.useRef(!1),{initAutoScroll:A,stopAutoScroll:L,dealDragAutoScroll:F,dealResizeAutoScroll:me}=Nr(v,y,P);let ge;e[2]===Symbol.for("react.memo_cache_sentinel")?(ge=(z,G)=>{const V=G===void 0?!0:G;if(!j.current)return;V&&(I.current=0);const B=j.current;B.style.setProperty("--translate-x",`${z}px`),B.dataset.left=String(z)},e[2]=ge):ge=e[2];const X=ge;let te;e[3]===Symbol.for("react.memo_cache_sentinel")?(te=(z,G)=>{const V=G===void 0?!0:G;if(!j.current)return;V&&(I.current=0);const B=j.current;B.style.width=`${z}px`,B.dataset.width=String(z)},e[3]=te):te=e[3];const U=te;let se;e[4]===Symbol.for("react.memo_cache_sentinel")?(se=()=>j.current?we(j.current.dataset.left):0,e[4]=se):se=e[4];const ee=se;let H;e[5]===Symbol.for("react.memo_cache_sentinel")?(H=()=>j.current?we(j.current.dataset.width):0,e[5]=H):H=e[5];const q=H;let it,at;e[6]!==o?(it=()=>{if(!j.current)return;const z=j.current;U(typeof o>"u"?z.offsetWidth:o,!1)},at=[o],e[6]=o,e[7]=it,e[8]=at):(it=e[7],at=e[8]),O.useEffect(it,at);let je,Ie;e[9]!==s?(je=()=>{X(s||0,!1)},Ie=[s],e[9]=s,e[10]=je,e[11]=Ie):(je=e[10],Ie=e[11]),O.useEffect(je,Ie);let Pe;e[12]===Symbol.for("react.memo_cache_sentinel")?(Pe=()=>({updateLeft:z=>X(z||0,!1),updateWidth:z=>U(z,!1),getLeft:ee,getWidth:q}),e[12]=Pe):Pe=e[12],O.useImperativeHandle(M,Pe);let Fe;e[13]!==A||e[14]!==w?(Fe=()=>{I.current=0,d.current=!1,A(),w?.()},e[13]=A,e[14]=w,e[15]=Fe):Fe=e[15];const Ue=Fe;let Le;e[16]!==W||e[17]!==E||e[18]!==h||e[19]!==K||e[20]!==Y||e[21]!==k||e[22]!==x?(Le=z=>{const{preLeft:G,preWidth:V,scrollDelta:B}=z;B&&(I.current=I.current+B);const le=d.current?K:E;if(Math.abs(I.current)<le)return;const ae=Math.trunc(I.current/le);let $=G+ae*le;const ue=I.current>0;let N=$;Y==="leading"?N=ue?$+V:$:Y==="right"?N=$+V:Y==="center"&&(N=$+V/2);const{snap:ne}=an(N,k,K);if(ne!==N)d.current=!0,Y==="leading"?$=ue?ne-V:ne:Y==="right"?$=ne-V:Y==="center"?$=ne-V/2:$=ne;else{const de=$-x;de%E!==0&&($=x+E*Math.round(de/E)),d.current=!1}I.current=I.current%le;const fe=W();$<fe.left?$=fe.left:$+V>fe.right&&($=fe.right-V),!(h&&h({lastLeft:G,left:$,lastWidth:V,width:V},B)===!1)&&X($,!1)},e[16]=W,e[17]=E,e[18]=h,e[19]=K,e[20]=Y,e[21]=k,e[22]=x,e[23]=Le):Le=e[23];const Ne=Le;let ct;e[24]!==Q||e[25]!==F||e[26]!==Ne||e[27]!==v?(ct=z=>{const G=z.target,V=we(G.dataset.left),B=we(G.dataset.width);I.current=I.current+z.dx,!(Q&&v?.current&&!F(z,$=>{if(!v?.current||!j.current)return;v.current.scrollLeft=v.current.scrollLeft+$;const ue=j.current,N=we(ue.dataset.left),ne=we(ue.dataset.width);Ne({preLeft:N,preWidth:ne,scrollDelta:$})}))&&Ne({preLeft:V,preWidth:B})},e[24]=Q,e[25]=F,e[26]=Ne,e[27]=v,e[28]=ct):ct=e[28];const Ot=ct;let ke;e[29]!==b||e[30]!==L?(ke=z=>{I.current=0,d.current=!1,L();const G=z.target;b?.({left:we(G.dataset.left),width:we(G.dataset.width)})},e[29]=b,e[30]=L,e[31]=ke):ke=e[31];const Te=ke;let We;e[32]!==A||e[33]!==S?(We=z=>{I.current=0,d.current=!1,A();const G=z.edges?.right?"right":"left";S?.(G)},e[32]=A,e[33]=S,e[34]=We):We=e[34];const Ve=We;let $e;e[35]!==W||e[36]!==E||e[37]!==_||e[38]!==K||e[39]!==k||e[40]!==x?($e=z=>{const{dir:G,preWidth:V,preLeft:B,scrollDelta:le}=z;le&&(I.current=I.current+le);const ae=d.current?K:E;if(Math.abs(I.current)<ae)return;const $=W();if(G==="left"){const ue=Math.trunc(I.current/ae);let N=B+ue*ae;const{snap:ne}=an(N,k,K);if(ne!==N)d.current=!0,N=ne;else{const ye=N-x;ye%E!==0&&(N=x+E*Math.round(ye/E)),d.current=!1}I.current=I.current%ae,N<$.left&&(N=$.left);const fe=B+V,de=fe-N;if(N>=fe||_&&_("left",{lastLeft:B,lastWidth:V,left:N,width:de})===!1)return;X(N,!1),U(de,!1)}else{const ue=Math.trunc(I.current/ae);let N=V+ue*ae;const ne=B+N,{snap:fe}=an(ne,k,K);if(fe!==ne)d.current=!0,N=fe-B;else{let de=B+N;const ye=de-x;ye%E!==0&&(de=x+E*Math.round(ye/E),N=de-B),d.current=!1}if(I.current=I.current%ae,B+N>$.right&&(N=$.right-B),N<=0||_&&_("right",{lastLeft:B,lastWidth:V,left:B,width:N})===!1)return;U(N,!1)}},e[35]=W,e[36]=E,e[37]=_,e[38]=K,e[39]=k,e[40]=x,e[41]=$e):$e=e[41];const ze=$e;let Ae;e[42]!==Q||e[43]!==me||e[44]!==v||e[45]!==ze?(Ae=z=>{const G=z.target,V=z.edges?.left?"left":"right",B=we(G.dataset.left),le=we(G.dataset.width);I.current=I.current+(V==="left"?z.deltaRect?.left||0:z.deltaRect?.right||0),!(Q&&v?.current&&!me(z,V,ue=>{if(!v?.current||!j.current)return;v.current.scrollLeft=v.current.scrollLeft+ue;const N=j.current,ne=we(N.dataset.left),fe=we(N.dataset.width);ze({preLeft:ne,preWidth:fe,dir:V,scrollDelta:ue})}))&&ze({preLeft:B,preWidth:le,dir:V})},e[42]=Q,e[43]=me,e[44]=v,e[45]=ze,e[46]=Ae):Ae=e[46];const He=Ae;let Be;e[47]!==T||e[48]!==L?(Be=z=>{I.current=0,d.current=!1,L();const G=z.target,V=z.edges?.right?"right":"left";T?.(V,{left:we(G.dataset.left),width:we(G.dataset.width)})},e[47]=T,e[48]=L,e[49]=Be):Be=e[49];const Xe=Be,nt=s||0,Ye=`${s||0}px`;let qe;e[50]!==Ye||e[51]!==o?(qe={"--translate-x":Ye,transform:"translateX(var(--translate-x)) scaleX(var(--scale-x,1))",width:o},e[50]=Ye,e[51]=o,e[52]=qe):qe=e[52];const Ke=qe;let Oe;e[53]!==Ot||e[54]!==Ue||e[55]!==Te?(Oe={lockAxis:"x",onmove:Ot,onstart:Ue,onend:Te,cursorChecker:ro},e[53]=Ot,e[54]=Ue,e[55]=Te,e[56]=Oe):Oe=e[56];let Ce;e[57]!==r||e[58]!==He||e[59]!==Ve||e[60]!==Xe?(Ce={axis:"x",invert:"none",edges:r,onmove:He,onstart:Ve,onend:Xe},e[57]=r,e[58]=He,e[59]=Ve,e[60]=Xe,e[61]=Ce):Ce=e[61];let Ge;return e[62]!==t||e[63]!==Z||e[64]!==J||e[65]!==nt||e[66]!==Ke||e[67]!==Oe||e[68]!==Ce?(Ge=C.jsx(no,{"data-left":nt,style:Ke,ref:j,draggable:Z,resizable:J,draggableOptions:Oe,resizableOptions:Ce,children:t}),e[62]=t,e[63]=Z,e[64]=J,e[65]=nt,e[66]=Ke,e[67]=Oe,e[68]=Ce,e[69]=Ge):Ge=e[69],Ge}function ro(){return""}function so(){return{left:Number.MIN_SAFE_INTEGER,right:Number.MAX_SAFE_INTEGER}}function oo(){let n=0,e,t="",r=arguments.length;for(;n<r;n++)(e=arguments[n])&&typeof e=="string"&&(t+=(t&&" ")+e);return t}const io=n=>{const e=De.c(200),{editorData:t,row:r,action:s,effects:o,rowHeight:i,scale:a,scaleWidth:c,scaleSplitCount:u,startLeft:l,gridSnap:m,disableDrag:f,autoScroll:p,autoScrollSpeed:S,autoScrollMaxSpeed:_,scaleCount:T,maxScaleCount:w,setScaleCount:b,onActionMoveStart:h,onActionMoving:v,onActionMoveEnd:R,onActionResizeStart:y,onActionResizeEnd:P,onActionResizing:M,snapData:x,setEditorData:E,onClickAction:W,onClickActionOnly:J,onDoubleClickAction:Z,onContextMenuAction:K,getActionRender:ie,handleTime:k,scrollContainerRef:Y}=n,Q=O.useRef(null),j=O.useRef(!1),{id:I,maxEnd:d,minStart:A,end:L,start:F,selected:me,flexible:ge,movable:X,effectId:te}=s,U=ge===void 0?!0:ge,se=X===void 0?!0:X,ee=a??D.DEFAULT_SCALE,H=c??D.DEFAULT_SCALE_WIDTH,q=l??D.DEFAULT_START_LEFT,it=u??D.DEFAULT_SCALE_SPLIT_COUNT,at=w??Number.MAX_SAFE_INTEGER,je=A||0;let Ie;e[0]!==ee||e[1]!==H||e[2]!==q||e[3]!==je?(Ie=D.parserTimeToPixel(je,{startLeft:q,scale:ee,scaleWidth:H}),e[0]=ee,e[1]=H,e[2]=q,e[3]=je,e[4]=Ie):Ie=e[4];const Pe=Ie,Fe=d||Number.MAX_VALUE;let Ue;e[5]!==ee||e[6]!==H||e[7]!==q||e[8]!==Fe?(Ue=D.parserTimeToPixel(Fe,{startLeft:q,scale:ee,scaleWidth:H}),e[5]=ee,e[6]=H,e[7]=q,e[8]=Fe,e[9]=Ue):Ue=e[9];const Le=Math.min(at*H+q,Ue);let Ne;e[10]!==L||e[11]!==ee||e[12]!==H||e[13]!==q||e[14]!==F?(Ne=D.parserTimeToTransform({start:F,end:L},{startLeft:q,scale:ee,scaleWidth:H}),e[10]=L,e[11]=ee,e[12]=H,e[13]=q,e[14]=F,e[15]=Ne):Ne=e[15];const ct=Ne,[Ot,ke]=O.useState(null),Te=Ot??ct,We=H/it;let Ve;e[16]!==te||e[17]!==o||e[18]!==U||e[19]!==se||e[20]!==me?(Ve=ve(oo("action",se&&"action-movable",me&&"action-selected",U&&"action-flexible",o[te]&&`action-effect-${te}`)),e[16]=te,e[17]=o,e[18]=U,e[19]=se,e[20]=me,e[21]=Ve):Ve=e[21];const $e=Ve;let ze;e[22]!==H||e[23]!==q||e[24]!==T||e[25]!==b?(ze=(Se,_e)=>{const oe=D.getScaleCountByPixel(Se+_e,{startLeft:q,scaleCount:T,scaleWidth:H});oe!==T&&b(oe)},e[22]=H,e[23]=q,e[24]=T,e[25]=b,e[26]=ze):ze=e[26];const Ae=ze;let He;e[27]!==s||e[28]!==h||e[29]!==r?(He=()=>{h&&h({action:s,row:r})},e[27]=s,e[28]=h,e[29]=r,e[30]=He):He=e[30];const Be=He;let Xe;e[31]!==s||e[32]!==Ae||e[33]!==v||e[34]!==r||e[35]!==ee||e[36]!==H||e[37]!==q?(Xe=Se=>{const{left:_e,width:oe}=Se;if(j.current=!0,v){const{start:pe,end:ce}=D.parserTransformToTime({left:_e,width:oe},{scaleWidth:H,scale:ee,startLeft:q});if(v({action:s,row:r,start:pe,end:ce})===!1)return!1}ke({left:_e,width:oe}),Ae(_e,oe)},e[31]=s,e[32]=Ae,e[33]=v,e[34]=r,e[35]=ee,e[36]=H,e[37]=q,e[38]=Xe):Xe=e[38];const nt=Xe;let Ye;e[39]!==t||e[40]!==I||e[41]!==R||e[42]!==r||e[43]!==ee||e[44]!==H||e[45]!==q||e[46]!==E?(Ye=Se=>{const{left:_e,width:oe}=Se,{start:pe,end:ce}=D.parserTransformToTime({left:_e,width:oe},{scaleWidth:H,scale:ee,startLeft:q}),he=t.find(et=>et.id===r.id);if(!he)return;const Qe=he.actions.find(et=>et.id===I);Qe&&(Qe.start=pe,Qe.end=ce,E([...t]),R&&R({action:Qe,row:r,start:pe,end:ce}),ke(null))},e[39]=t,e[40]=I,e[41]=R,e[42]=r,e[43]=ee,e[44]=H,e[45]=q,e[46]=E,e[47]=Ye):Ye=e[47];const qe=Ye;let Ke;e[48]!==s||e[49]!==y||e[50]!==r?(Ke=Se=>{y&&y({action:s,row:r,dir:Se})},e[48]=s,e[49]=y,e[50]=r,e[51]=Ke):Ke=e[51];const Oe=Ke;let Ce;e[52]!==s||e[53]!==Ae||e[54]!==M||e[55]!==r||e[56]!==ee||e[57]!==H||e[58]!==q?(Ce=(Se,_e)=>{const{left:oe,width:pe}=_e;if(j.current=!0,M){const{start:ce,end:he}=D.parserTransformToTime({left:oe,width:pe},{scaleWidth:H,scale:ee,startLeft:q});if(M({action:s,row:r,start:ce,end:he,dir:Se})===!1)return!1}ke({left:oe,width:pe}),Ae(oe,pe)},e[52]=s,e[53]=Ae,e[54]=M,e[55]=r,e[56]=ee,e[57]=H,e[58]=q,e[59]=Ce):Ce=e[59];const Ge=Ce;let z;e[60]!==t||e[61]!==I||e[62]!==P||e[63]!==r||e[64]!==ee||e[65]!==H||e[66]!==q||e[67]!==E?(z=(Se,_e)=>{const{left:oe,width:pe}=_e,{start:ce,end:he}=D.parserTransformToTime({left:oe,width:pe},{scaleWidth:H,scale:ee,startLeft:q}),Qe=t.find(Qt=>Qt.id===r.id);if(!Qe)return;const et=Qe.actions.find(Qt=>Qt.id===I);et&&(et.start=ce,et.end=he,E([...t]),P&&P({action:et,row:r,start:ce,end:he,dir:Se}),ke(null))},e[60]=t,e[61]=I,e[62]=P,e[63]=r,e[64]=ee,e[65]=H,e[66]=q,e[67]=E,e[68]=z):z=e[68];const G=z;let V,B,le,ae,$,ue,N,ne,fe,de,ye,lt,ut,ft,dt,ht,Je,Ze,mt,pt,gt,vt,bt,St,_t,wt,Et,yt,Tt;if(e[69]!==s||e[70]!==p||e[71]!==_||e[72]!==S||e[73]!==$e||e[74]!==f||e[75]!==U||e[76]!==ie||e[77]!==We||e[78]!==m||e[79]!==nt||e[80]!==qe||e[81]!==Be||e[82]!==G||e[83]!==Oe||e[84]!==Ge||e[85]!==k||e[86]!==Pe||e[87]!==se||e[88]!==W||e[89]!==J||e[90]!==K||e[91]!==Z||e[92]!==Le||e[93]!==r||e[94]!==i||e[95]!==ee||e[96]!==H||e[97]!==q||e[98]!==Y||e[99]!==x.assistPositions||e[100]!==Te.left||e[101]!==Te.width){const Se={...s,...D.parserTransformToTime({left:Te.left,width:Te.width},{startLeft:q,scaleWidth:H,scale:ee})},_e={...r,actions:[...r.actions]};r.actions.includes(s)&&(_e.actions[r.actions.indexOf(s)]=Se),V=dr,fe=Q,de=Y,ye=q,lt=Te.left,ut=Te.width,ft=m&&We||D.DEFAULT_MOVE_GRID,dt=m?Math.max((We||D.DEFAULT_MOVE_GRID)/2,D.DEFAULT_SNAP_DISTANCE):D.DEFAULT_SNAP_DISTANCE,ht=x.assistPositions,e[131]!==Pe||e[132]!==Le?(Je=()=>({left:Pe,right:Le}),e[131]=Pe,e[132]=Le,e[133]=Je):Je=e[133];let oe;e[134]!==f||e[135]!==U?(oe=!f&&U&&`.${ve("action-left-stretch")}`,e[134]=f,e[135]=U,e[136]=oe):oe=e[136];let pe;e[137]!==f||e[138]!==U?(pe=!f&&U&&`.${ve("action-right-stretch")}`,e[137]=f,e[138]=U,e[139]=pe):pe=e[139],e[140]!==oe||e[141]!==pe?(Ze={left:oe,right:pe},e[140]=oe,e[141]=pe,e[142]=Ze):Ze=e[142],mt=!f&&se,pt=!f&&U,gt=Be,vt=nt,bt=qe,St=Oe,_t=Ge,wt=G,Et=p,yt=S,Tt=_,e[143]===Symbol.for("react.memo_cache_sentinel")?(B=()=>{j.current=!1},e[143]=B):B=e[143],e[144]!==s||e[145]!==k||e[146]!==W||e[147]!==J||e[148]!==r?(le=ce=>{let he;W&&(he=k(ce),W(ce,{row:r,action:s,time:he})),!j.current&&J&&(he===void 0&&(he=k(ce)),J(ce,{row:r,action:s,time:he}))},e[144]=s,e[145]=k,e[146]=W,e[147]=J,e[148]=r,e[149]=le):le=e[149],e[150]!==s||e[151]!==k||e[152]!==Z||e[153]!==r?(ae=ce=>{if(Z){const he=k(ce);Z(ce,{row:r,action:s,time:he})}},e[150]=s,e[151]=k,e[152]=Z,e[153]=r,e[154]=ae):ae=e[154],e[155]!==s||e[156]!==k||e[157]!==K||e[158]!==r?($=ce=>{if(K){const he=k(ce);K(ce,{row:r,action:s,time:he})}},e[155]=s,e[156]=k,e[157]=K,e[158]=r,e[159]=$):$=e[159],ue=$e,e[160]!==i?(N={height:i},e[160]=i,e[161]=N):N=e[161],ne=ie&&ie(Se,_e),e[69]=s,e[70]=p,e[71]=_,e[72]=S,e[73]=$e,e[74]=f,e[75]=U,e[76]=ie,e[77]=We,e[78]=m,e[79]=nt,e[80]=qe,e[81]=Be,e[82]=G,e[83]=Oe,e[84]=Ge,e[85]=k,e[86]=Pe,e[87]=se,e[88]=W,e[89]=J,e[90]=K,e[91]=Z,e[92]=Le,e[93]=r,e[94]=i,e[95]=ee,e[96]=H,e[97]=q,e[98]=Y,e[99]=x.assistPositions,e[100]=Te.left,e[101]=Te.width,e[102]=V,e[103]=B,e[104]=le,e[105]=ae,e[106]=$,e[107]=ue,e[108]=N,e[109]=ne,e[110]=fe,e[111]=de,e[112]=ye,e[113]=lt,e[114]=ut,e[115]=ft,e[116]=dt,e[117]=ht,e[118]=Je,e[119]=Ze,e[120]=mt,e[121]=pt,e[122]=gt,e[123]=vt,e[124]=bt,e[125]=St,e[126]=_t,e[127]=wt,e[128]=Et,e[129]=yt,e[130]=Tt}else V=e[102],B=e[103],le=e[104],ae=e[105],$=e[106],ue=e[107],N=e[108],ne=e[109],fe=e[110],de=e[111],ye=e[112],lt=e[113],ut=e[114],ft=e[115],dt=e[116],ht=e[117],Je=e[118],Ze=e[119],mt=e[120],pt=e[121],gt=e[122],vt=e[123],bt=e[124],St=e[125],_t=e[126],wt=e[127],Et=e[128],yt=e[129],Tt=e[130];let Rt;e[162]!==U?(Rt=U&&C.jsx("div",{className:ve("action-left-stretch"),style:{touchAction:"none"}}),e[162]=U,e[163]=Rt):Rt=e[163];let xt;e[164]!==U?(xt=U&&C.jsx("div",{className:ve("action-right-stretch"),style:{touchAction:"none"}}),e[164]=U,e[165]=xt):xt=e[165];let At;e[166]!==B||e[167]!==le||e[168]!==ae||e[169]!==$||e[170]!==ue||e[171]!==N||e[172]!==ne||e[173]!==Rt||e[174]!==xt?(At=C.jsxs("div",{onMouseDown:B,onClick:le,onDoubleClick:ae,onContextMenu:$,className:ue,style:N,children:[ne,Rt,xt]}),e[166]=B,e[167]=le,e[168]=ae,e[169]=$,e[170]=ue,e[171]=N,e[172]=ne,e[173]=Rt,e[174]=xt,e[175]=At):At=e[175];let jt;return e[176]!==V||e[177]!==fe||e[178]!==de||e[179]!==ye||e[180]!==lt||e[181]!==ut||e[182]!==ft||e[183]!==dt||e[184]!==ht||e[185]!==Je||e[186]!==Ze||e[187]!==mt||e[188]!==pt||e[189]!==gt||e[190]!==vt||e[191]!==bt||e[192]!==St||e[193]!==_t||e[194]!==wt||e[195]!==Et||e[196]!==yt||e[197]!==Tt||e[198]!==At?(jt=C.jsx(V,{ref:fe,parentRef:de,start:ye,left:lt,width:ut,grid:ft,snapDistance:dt,snapPositions:ht,getBounds:Je,edges:Ze,enableDragging:mt,enableResizing:pt,onDragStart:gt,onDrag:vt,onDragEnd:bt,onResizeStart:St,onResize:_t,onResizeEnd:wt,autoScroll:Et,autoScrollSpeed:yt,autoScrollMaxSpeed:Tt,children:At}),e[176]=V,e[177]=fe,e[178]=de,e[179]=ye,e[180]=lt,e[181]=ut,e[182]=ft,e[183]=dt,e[184]=ht,e[185]=Je,e[186]=Ze,e[187]=mt,e[188]=pt,e[189]=gt,e[190]=vt,e[191]=bt,e[192]=St,e[193]=_t,e[194]=wt,e[195]=Et,e[196]=yt,e[197]=Tt,e[198]=At,e[199]=jt):jt=e[199],jt};function Dt(n,e,t){let r=t.initialDeps??[],s;function o(){var i,a,c,u;let l;t.key&&((i=t.debug)!=null&&i.call(t))&&(l=Date.now());const m=n();if(!(m.length!==r.length||m.some((S,_)=>r[_]!==S)))return s;r=m;let p;if(t.key&&((a=t.debug)!=null&&a.call(t))&&(p=Date.now()),s=e(...m),t.key&&((c=t.debug)!=null&&c.call(t))){const S=Math.round((Date.now()-l)*100)/100,_=Math.round((Date.now()-p)*100)/100,T=_/16,w=(b,h)=>{for(b=String(b);b.length<h;)b=" "+b;return b};console.info(`%c⏱ ${w(_,5)} /${w(S,5)} ms`,`
11
11
  font-size: .6rem;
12
12
  font-weight: bold;
13
- color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,t?.key)}return(u=t?.onChange)==null||u.call(t,s),s}return o.updateDeps=i=>{r=i},o}function Dn(n,e){if(n===void 0)throw new Error("Unexpected undefined");return n}const eo=(n,e)=>Math.abs(n-e)<1.01,to=(n,e,t)=>{let r;return function(...s){n.clearTimeout(r),r=n.setTimeout(()=>e.apply(this,s),t)}},On=n=>{const{offsetWidth:e,offsetHeight:t}=n;return{width:e,height:t}},no=n=>n,ro=n=>{const e=Math.max(n.startIndex-n.overscan,0),t=Math.min(n.endIndex+n.overscan,n.count-1),r=[];for(let s=e;s<=t;s++)r.push(s);return r},so=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;const s=i=>{const{width:c,height:a}=i;e({width:Math.round(c),height:Math.round(a)})};if(s(On(t)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const c=()=>{const a=i[0];if(a?.borderBoxSize){const u=a.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(On(t))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Mn={passive:!0},Nn=typeof window>"u"?!0:"onscrollend"in window,oo=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;let s=0;const o=n.options.useScrollendEvent&&Nn?()=>{}:to(r,()=>{e(s,!1)},n.options.isScrollingResetDelay),i=l=>()=>{const{horizontal:m,isRtl:f}=n.options;s=m?t.scrollLeft*(f&&-1||1):t.scrollTop,o(),e(s,l)},c=i(!0),a=i(!1);a(),t.addEventListener("scroll",c,Mn);const u=n.options.useScrollendEvent&&Nn;return u&&t.addEventListener("scrollend",a,Mn),()=>{t.removeEventListener("scroll",c),u&&t.removeEventListener("scrollend",a)}},io=(n,e,t)=>{if(e?.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return n[t.options.horizontal?"offsetWidth":"offsetHeight"]},co=(n,{adjustments:e=0,behavior:t},r)=>{var s,o;const i=n+e;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:i,behavior:t})};class ao{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const i=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var o;return(o=r())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=r())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,s])=>{typeof s>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:no,rangeExtractor:ro,onChange:()=>{},measureElement:io,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=yt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const s=new Map,o=new Map;for(let i=r-1;i>=0;i--){const c=t[i];if(s.has(c.lane))continue;const a=o.get(c.lane);if(a==null||c.end>a.end?o.set(c.lane,c):c.end<a.end&&s.set(c.lane,!0),s.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,c)=>i.end===c.end?i.index-c.index:i.end-c.end)[0]:void 0},this.getMeasurementOptions=yt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,r,s,o,i)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i}),{key:!1}),this.getMeasurements=yt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i},c)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(l=>{this.itemSizeCache.set(l.key,l.size)}));const a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,a);for(let l=a;l<t;l++){const m=o(l),f=this.options.lanes===1?u[l-1]:this.getFurthestMeasurement(u,l),g=f?f.end+this.options.gap:r+s,w=c.get(m),S=typeof w=="number"?w:this.options.estimateSize(l),y=g+S,_=f?f.lane:l%this.options.lanes;u[l]={index:l,start:g,size:S,end:y,key:m,lane:_}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=yt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,o)=>this.range=t.length>0&&r>0?lo({measurements:t,outerSize:r,scrollOffset:s,lanes:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=yt(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,o,i)=>o===null||i===null?[]:t({startIndex:o,endIndex:i,overscan:r,count:s}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const s=this.indexFromElement(t),o=this.measurementsCache[s];if(!o)return;const i=o.key,c=this.elementsCache.get(i);c!==t&&(c&&this.observer.unobserve(c),this.observer.observe(t),this.elementsCache.set(i,t)),t.isConnected&&this.resizeItem(s,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const s=this.measurementsCache[t];if(!s)return;const o=this.itemSizeCache.get(s.key)??s.size,i=r-o;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,i,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(t,void 0)},this.getVirtualItems=yt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let o=0,i=t.length;o<i;o++){const c=t[o],a=r[c];s.push(a)}return s},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return Dn(r[ar(0,r.length-1,s=>Dn(r[s]).start,t)])},this.getOffsetForAlignment=(t,r,s=0)=>{const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=t>=i+o?"end":"start"),r==="center"?t+=(s-o)/2:r==="end"&&(t-=o);const c=this.getTotalSize()+this.options.scrollMargin-o;return Math.max(Math.min(c,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.measurementsCache[t];if(!s)return;const o=this.getSize(),i=this.getScrollOffset();if(r==="auto")if(s.end>=i+o-this.options.scrollPaddingEnd)r="end";else if(s.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];const c=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:r="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(t,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let o=0;const i=10,c=u=>{if(!this.targetWindow)return;const l=this.getOffsetForIndex(t,u);if(!l){console.warn("Failed to get offset for index:",t);return}const[m,f]=l;this._scrollToOffset(m,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const g=this.getScrollOffset(),w=this.getOffsetForIndex(t,f);if(!w){console.warn("Failed to get offset for index:",t);return}eo(w[0],g)||a(f)})},a=u=>{this.targetWindow&&(o++,o<i?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",o,i),this.targetWindow.requestAnimationFrame(()=>c(u))):console.warn(`Failed to scroll to index ${t} after ${i} attempts.`))};c(r)},this.scrollBy=(t,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((t=r[r.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(c=>c===null);){const c=r[i];o[c.lane]===null&&(o[c.lane]=c.end),i--}s=Math.max(...o.filter(c=>c!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const ar=(n,e,t,r)=>{for(;n<=e;){const s=(n+e)/2|0,o=t(s);if(o<r)n=s+1;else if(o>r)e=s-1;else return s}return n>0?n-1:0};function lo({measurements:n,outerSize:e,scrollOffset:t,lanes:r}){const s=n.length-1,o=a=>n[a].start;if(n.length<=r)return{startIndex:0,endIndex:s};let i=ar(0,s,o,t),c=i;if(r===1)for(;c<s&&n[c].end<t+e;)c++;else if(r>1){const a=Array(r).fill(0);for(;c<s&&a.some(l=>l<t+e);){const l=n[c];a[l.lane]=l.end,c++}const u=Array(r).fill(t+e);for(;i>=0&&u.some(l=>l>=t);){const l=n[i];u[l.lane]=l.start,i--}i=Math.max(0,i-i%r),c=Math.min(s,c+(r-1-c%r))}return{startIndex:i,endIndex:c}}const In=typeof document<"u"?b.useLayoutEffect:b.useEffect;function uo(n){const e=b.useReducer(()=>({}),{})[1],t={...n,onChange:(s,o)=>{var i;o?fr.flushSync(e):e(),(i=n.onChange)==null||i.call(n,s,o)}},[r]=b.useState(()=>new ao(t));return r.setOptions(t),In(()=>r._didMount(),[]),In(()=>r._willUpdate()),r}function lr(n){return uo({observeElementRect:so,observeElementOffset:oo,scrollToFn:co,...n})}const fo=n=>{const{rowData:e,style:t={},onClickRow:r,onDoubleClickRow:s,onContextMenuRow:o,scrollContainerRef:i,startLeft:c,scale:a,scaleWidth:u,unstable_rowActionsOverscan:l}=n,m=["edit-row"];e?.selected&&m.push("edit-row-selected");const f=a??A.DEFAULT_SCALE,g=u??A.DEFAULT_SCALE_WIDTH,w=c??A.DEFAULT_START_LEFT,S=p=>{if(!i.current)return 0;const R=p.currentTarget.getBoundingClientRect(),C=p.clientX-R.x;return A.parserPixelToTime(C,{startLeft:w,scale:f,scaleWidth:g})},y=L.useMemo(()=>(e?.actions?[...e.actions]:[]).sort((p,v)=>p.start-v.start),[e]),_=L.useCallback(p=>y[p]?.id??p,[y]),h=lr({horizontal:!0,count:y.length,getItemKey:_,getScrollElement:()=>i.current,estimateSize:p=>{if(!y[p])return 0;let v=p>0?y[p-1].end:0,R=y[p].end;if(v>R)return 0;let{width:E}=A.parserTimeToTransform({start:v,end:R},{startLeft:w,scale:f,scaleWidth:g});return E},overscan:l??5});return L.useEffect(()=>h.measure(),[f,g,w,h]),T.jsx("div",{className:`${ge(...m)} ${(e?.classNames||[]).join(" ")}`,style:t,onClick:p=>{if(e&&r){const v=S(p);r(p,{row:e,time:v})}},onDoubleClick:p=>{if(e&&s){const v=S(p);s(p,{row:e,time:v})}},onContextMenu:p=>{if(e&&o){const v=S(p);o(p,{row:e,time:v})}},children:e&&h.getVirtualItems().map(p=>{const v=y[p.index];if(!v)throw new Error("Action not found");return T.jsx(Qs,{...n,handleTime:S,row:e,action:v},v.id)})})};function ho(){const n=Oe.c(7);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={isMoving:!1,movePositions:[],assistPositions:[]},n[0]=e):e=n[0];const[t,r]=L.useState(e),s=L.useRef(null),o=po,i=mo;let c;n[1]===Symbol.for("react.memo_cache_sentinel")?(c=y=>{const{movePositions:_,assistPositions:h,action:p,row:v,assistActionIds:R}=y;s.current={action:p,row:v,assistActionIds:R},r({isMoving:!0,movePositions:_||[],assistPositions:h||[]})},n[1]=c):c=n[1];const a=c;let u;n[2]===Symbol.for("react.memo_cache_sentinel")?(u=y=>{const{movePositions:_,assistPositions:h}=y;r(p=>({...p,movePositions:_||p.movePositions,assistPositions:h||p.assistPositions}))},n[2]=u):u=n[2];const l=u;let m;n[3]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{s.current=null,r({isMoving:!1,movePositions:[],assistPositions:[]})},n[3]=m):m=n[3];const f=m;let g;n[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>s.current,n[4]=g):g=n[4];const w=g;let S;return n[5]!==t?(S={initSnap:a,updateSnap:l,disposeSnap:f,snapData:t,getActiveDragState:w,defaultGetAssistPosition:o,defaultGetMovePosition:i},n[5]=t,n[6]=S):S=n[6],S}function mo(n){const{start:e,end:t,dir:r,scale:s,scaleWidth:o,startLeft:i}=n,{left:c,width:a}=A.parserTimeToTransform({start:e,end:t},{startLeft:i,scaleWidth:o,scale:s});return r?r==="right"?[c+a]:[c]:[c,c+a]}function po(n){const{editorData:e,assistActionIds:t,action:r,row:s,scale:o,scaleWidth:i,startLeft:c,cursorLeft:a,hideCursor:u}=n,l=[];t?e.forEach(f=>{f.actions.forEach(g=>{t.includes(g.id)&&l.push(g)})}):e.forEach(f=>{f.id!==s.id?l.push(...f.actions):f.actions.forEach(g=>{g.id!==r.id&&l.push(g)})});const m=A.parserActionsToPositions(l,{startLeft:c,scale:o,scaleWidth:i});return u||m.push(a),m}const go=({ref:n,...e})=>{const{snapData:t,initSnap:r,updateSnap:s,disposeSnap:o,getActiveDragState:i,defaultGetAssistPosition:c,defaultGetMovePosition:a}=ho();L.useEffect(()=>{const _=i();if(e.snap&&_&&t.isMoving){const h=e.scaleWidth??160,p=e.scale??1,v=e.startLeft??20,R=e.hideCursor??!1,E=A.parserTimeToPixel(e.cursorTime,{scaleWidth:h,scale:p,startLeft:v}),C=c({editorData:e.editorData,assistActionIds:_.assistActionIds,action:_.action,row:_.row,scale:p,scaleWidth:h,startLeft:v,hideCursor:R,cursorLeft:E});s({assistPositions:C})}else!e.snap&&t.isMoving&&s({assistPositions:[]})},[e.snap,t.isMoving]);const u=_=>{const h=e.getAssistDragLineActionIds&&e.getAssistDragLineActionIds({action:_.action,row:_.row,editorData:e.editorData});if(e.snap){const p=e.scaleWidth??160,v=e.scale??1,R=e.startLeft??20,E=e.hideCursor??!1,C=A.parserTimeToPixel(e.cursorTime,{scaleWidth:p,scale:v,startLeft:R}),z=c({editorData:e.editorData,assistActionIds:h,action:_.action,row:_.row,scale:v,scaleWidth:p,startLeft:R,hideCursor:E,cursorLeft:C});r({assistPositions:z,action:_.action,row:_.row,assistActionIds:h})}else r({assistPositions:[],action:_.action,row:_.row,assistActionIds:h})},l=_=>{if(e.snap){const h=e.scaleWidth??160,p=e.scale??1,v=e.startLeft??20,R=a({..._,startLeft:v,scaleWidth:h,scale:p});s({movePositions:R})}},m=e.rowHeight??32,f=e.scaleWidth??160,g=e.startLeft??20,w=Math.max(e.scaleCount*f+g,e.timelineWidth),[S,y]=(()=>{let _=[],h=0;for(let p=0;p<e.editorData.length;p++){const v=e.editorData[p];if(!v)continue;const R=v.rowHeight||m;_.push(L.createElement(fo,{...e,key:v.id,rowData:v,snapData:t,scrollContainerRef:e.scrollElementRef,style:{position:"absolute",top:0,left:0,width:w,height:`${R}px`,transform:`translateY(${h}px)`},onActionMoveStart:E=>(u(E),e.onActionMoveStart&&e.onActionMoveStart(E)),onActionResizeStart:E=>(u(E),e.onActionResizeStart&&e.onActionResizeStart(E)),onActionMoving:E=>(l(E),e.onActionMoving&&e.onActionMoving(E)),onActionResizing:E=>(l(E),e.onActionResizing&&e.onActionResizing(E)),onActionResizeEnd:E=>(o(),e.onActionResizeEnd&&e.onActionResizeEnd(E)),onActionMoveEnd:E=>(o(),e.onActionMoveEnd&&e.onActionMoveEnd(E))})),h+=R}return[h,_]})();return T.jsxs("div",{ref:n,style:{width:w,height:S,position:"relative",backgroundPositionX:`0, ${e.startLeft??20}px`,backgroundSize:`${e.startLeft??20}px, ${e.scaleWidth??160}px`},className:"timeline-editor-edit-area",children:[y,e.snap&&T.jsx(xr,{...t})]})};function vo({scaleSplitCount:n,scaleWidth:e,startLeft:t,scaleCount:r,maxScaleCount:s,scale:o,scrollElementRef:i,onClickTimeArea:c,setCursor:a,getScaleRender:u}){const l=n??1,m=e??160,f=t??20,g=(n??0)>0,w=g?r*(n??1)+1:r,S=(g?m/l:m)*(w-1)+f,_=lr({horizontal:!0,count:w,getScrollElement:()=>i.current,estimateSize:h=>{switch(h){case 0:return f;default:return g?m/l:m}},overscan:10});return L.useEffect(()=>_.measure(),[o,e,t,_]),T.jsx("div",{style:{width:`${S}px`},className:ge("time-area"),onClick:h=>{const p=t??20,v=e??160,R=o??1,E=s??1/0,C=h.currentTarget.getBoundingClientRect(),z=h.clientX-C.x,D=Math.max(z,p);if(D>E*v+p)return;const j=A.parserPixelToTime(D,{startLeft:p,scale:R,scaleWidth:v});c&&c(j,h),!h.defaultPrevented&&a({time:j})},children:_.getVirtualItems().map(h=>{const p=h.index,v=n??1,R=o??1,E=g?p%v===0:!0,C=[ge("time-unit"),ge(E?"time-unit-big":"time-unit-small")],z=(g?p/v:p)*R;return T.jsx("div",{"data-index":h.index,style:{width:`${h.size}px`,transform:`translateX(${h.start}px)`},className:C.join(" "),children:T.jsx(L.Activity,{mode:E?"visible":"hidden",children:T.jsx("div",{className:ge("time-unit-scale"),children:u?.(z)??z})})},h.key)})})}function bo(n){return typeof n=="object"&&n!==null}function So(n,e,t){if(n instanceof EventTarget)return[n];if(typeof n=="string"){const s=document.querySelectorAll(n);return s?Array.from(s):[]}return Array.from(n)}function _o(n){return bo(n)&&"ownerSVGElement"in n}const jt=new WeakMap;let Ft;const ur=(n,e,t)=>(r,s)=>s&&s[0]?s[0][n+"Size"]:_o(r)&&"getBBox"in r?r.getBBox()[e]:r[t],wo=ur("inline","width","offsetWidth"),Eo=ur("block","height","offsetHeight");function yo({target:n,borderBoxSize:e}){jt.get(n)?.forEach(t=>{t(n,{get width(){return wo(n,e)},get height(){return Eo(n,e)}})})}function To(n){n.forEach(yo)}function Ro(){typeof ResizeObserver>"u"||(Ft=new ResizeObserver(To))}function xo(n,e){Ft||Ro();const t=So(n);return t.forEach(r=>{let s=jt.get(r);s||(s=new Set,jt.set(r,s)),s.add(e),Ft?.observe(r)}),()=>{t.forEach(r=>{const s=jt.get(r);s?.delete(e),s?.size||Ft?.unobserve(r)})}}const Ut=new Set;let Tt;function Ao(){Tt=()=>{const n={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ut.forEach(e=>e(n))},window.addEventListener("resize",Tt)}function Co(n){return Ut.add(n),Tt||Ao(),()=>{Ut.delete(n),!Ut.size&&typeof Tt=="function"&&(window.removeEventListener("resize",Tt),Tt=void 0)}}function Po(n,e){return typeof n=="function"?Co(n):xo(n,e)}function Lo(n){const e=Oe.c(4),{elementRef:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={width:0,height:0},e[0]=r):r=e[0];const[s,o]=L.useState(r);let i,c;return e[1]!==t?(i=()=>{t.current&&Po(t.current,(a,u)=>{o({width:u.width,height:u.height})})},c=[t],e[1]=t,e[2]=i,e[3]=c):(i=e[2],c=e[3]),L.useLayoutEffect(i,c),s}const Do=n=>{const e=Oe.c(47),{disableDrag:t,cursorTime:r,setCursor:s,startLeft:o,scaleWidth:i,scale:c,scaleCount:a,scaleSplitCount:u,scrollElementRef:l,maxScaleCount:m,onCursorDragStart:f,onCursorDrag:g,onCursorDragEnd:w,cursorSnap:S,editorData:y}=n,_=L.useRef(null),h=L.useRef(void 0),p=o??20,v=i??160,R=c??1;let E;e[0]!==S?(E=(k,U,N,W)=>{if(!S||!k)return[];const O=k.flatMap(Oo);return A.parserActionsToPositions(O,{startLeft:U,scale:W,scaleWidth:N})},e[0]=S,e[1]=E):E=e[1];const C=E,z=Mo;let D,j;e[2]!==r||e[3]!==c||e[4]!==i||e[5]!==o?(D=()=>{if(typeof h.current>"u"&&_.current){const k=o??20,U=i??160,N=c??1;_.current.updateLeft(A.parserTimeToPixel(r,{startLeft:k,scaleWidth:U,scale:N}))}},j=[r,o,i,c],e[2]=r,e[3]=c,e[4]=i,e[5]=o,e[6]=D,e[7]=j):(D=e[6],j=e[7]),L.useEffect(D,j);const H=m??1/0,te=(u??0)>0,B=u??1,re=te?a*(u??1)+1:a,q=o??20,P=(te?v/B:v)*(re-1)+q;let I;e[8]!==p||e[9]!==H||e[10]!==l||e[11]!==P||e[12]!==v?(I=()=>({left:0,right:Math.min(P,H*v+p-(l.current?.scrollLeft??0))}),e[8]=p,e[9]=H,e[10]=l,e[11]=P,e[12]=v,e[13]=I):I=e[13];const J=!t;let Z;e[14]!==r||e[15]!==p||e[16]!==f||e[17]!==R||e[18]!==v?(Z=()=>{const k=_.current?.getLeft()??A.parserTimeToPixel(r,{startLeft:p,scaleWidth:v,scale:R});h.current=k;const U=A.parserPixelToTime(k,{startLeft:p,scale:R,scaleWidth:v});f&&f(U),_.current?.updateLeft(k)},e[14]=r,e[15]=p,e[16]=f,e[17]=R,e[18]=v,e[19]=Z):Z=e[19];let Q;e[20]!==p||e[21]!==w||e[22]!==R||e[23]!==s||e[24]!==v?(Q=()=>{if(typeof h.current<"u"){const k=A.parserPixelToTime(h.current,{startLeft:p,scale:R,scaleWidth:v});s({time:k}),w&&w(k)}h.current=void 0},e[20]=p,e[21]=w,e[22]=R,e[23]=s,e[24]=v,e[25]=Q):Q=e[25];let d;e[26]!==S||e[27]!==y||e[28]!==C||e[29]!==p||e[30]!==g||e[31]!==R||e[32]!==l||e[33]!==s||e[34]!==v?(d=(k,U)=>{const{left:N}=k,W=U===void 0?0:U,O=l.current?.scrollLeft??0,Ne=l.current,Ae=Ne?.clientWidth??0;if(W!==0)if(typeof h.current<"u"){h.current=h.current+W;const ne=O,se=O+Ae;h.current<ne+10?h.current=ne+10:h.current>se-10&&(h.current=se-10),h.current<p-O&&(h.current=p-O)}else{h.current=N+W;const ne=O,se=O+Ae;h.current<ne+10?h.current=ne+10:h.current>se-10&&(h.current=se-10)}else if(N<p-O?h.current=p-O:h.current=N,Ne&&Ae>0){const ne=O,se=O+Ae;h.current<ne+10?h.current=ne+10:h.current>se-10&&(h.current=se-10)}if(typeof h.current<"u"){let ne=h.current;if(S){const Ee=C(y,p,v,R);Ee.length>0&&(ne=z(h.current,Ee,A.DEFAULT_SNAP_DISTANCE),h.current=ne)}_.current?.updateLeft(ne);const se=A.parserPixelToTime(ne,{startLeft:p,scale:R,scaleWidth:v});s({time:se}),g&&g(se)}return!1},e[26]=S,e[27]=y,e[28]=C,e[29]=p,e[30]=g,e[31]=R,e[32]=l,e[33]=s,e[34]=v,e[35]=d):d=e[35];let x,M;e[36]===Symbol.for("react.memo_cache_sentinel")?(M=ge("cursor"),x=ge("cursor-top"),e[36]=x,e[37]=M):(x=e[36],M=e[37]);let $;e[38]===Symbol.for("react.memo_cache_sentinel")?($=T.jsxs("div",{className:M,children:[T.jsx("svg",{className:x,width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",children:T.jsx("path",{d:"M0 1C0 0.447715 0.447715 0 1 0H7C7.55228 0 8 0.447715 8 1V9.38197C8 9.76074 7.786 10.107 7.44721 10.2764L4.44721 11.7764C4.16569 11.9172 3.83431 11.9172 3.55279 11.7764L0.552786 10.2764C0.214002 10.107 0 9.76074 0 9.38197V1Z",fill:"currentColor"})}),T.jsx("div",{className:ge("cursor-area")})]}),e[38]=$):$=e[38];let fe;return e[39]!==p||e[40]!==l||e[41]!==I||e[42]!==J||e[43]!==Z||e[44]!==Q||e[45]!==d?(fe=T.jsx(cr,{start:p,ref:_,parentRef:l,getBounds:I,autoScroll:!0,enableDragging:J,enableResizing:!1,onDragStart:Z,onDragEnd:Q,onDrag:d,children:$}),e[39]=p,e[40]=l,e[41]=I,e[42]=J,e[43]=Z,e[44]=Q,e[45]=d,e[46]=fe):fe=e[46],fe};function Oo(n){return n.actions}function Mo(n,e,t){let r=n,s=Number.MAX_SAFE_INTEGER;for(const o of e){const i=Math.abs(o-n);i<t&&i<s&&(r=o,s=i)}return r}function kn(n){const e=Oe.c(9);let t,r,s;e[0]!==n?({className:t,orientation:s,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);const o=s===void 0?"vertical":s;let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=T.jsx(nr,{"data-slot":"scroll-area-thumb"}),e[4]=i):i=e[4];let c;return e[5]!==t||e[6]!==o||e[7]!==r?(c=T.jsx(Zn,{"data-slot":"scroll-area-scrollbar",orientation:o,className:t,...r,children:i}),e[5]=t,e[6]=o,e[7]=r,e[8]=c):c=e[8],c}function No(n){const e=Oe.c(7),{scrollElementRef:t,scale:r,scaleWidth:s,startLeft:o,cursorTimeRef:i}=n,c=L.useRef(null),a=L.useRef(null);let u,l;e[0]!==i||e[1]!==r||e[2]!==s||e[3]!==t||e[4]!==o?(u=()=>{const m=t.current;if(c.current!==null&&a.current!==null&&m&&(c.current!==r||a.current!==s)){const f=m.scrollLeft,g=i.current,w=A.parserTimeToPixel(g,{startLeft:o,scale:c.current,scaleWidth:a.current}),S=A.parserTimeToPixel(g,{startLeft:o,scale:r,scaleWidth:s}),y=w-f,_=S-y;m.scrollLeft=_}c.current=r,a.current=s},l=[r,s,o,t,i],e[0]=i,e[1]=r,e[2]=s,e[3]=t,e[4]=o,e[5]=u,e[6]=l):(u=e[5],l=e[6]),L.useLayoutEffect(u,l)}function Io({ref:n,...e}){const t=wr(e),r=L.useRef(null),{width:s,height:o}=Lo({elementRef:r}),i=t.minScaleCount??Math.max(A.getScaleCountByRows(t.editorData,{scale:t.scale,pad:.1}),Math.ceil((s-t.startLeft)/t.scaleWidth)),c=Math.min(t.maxScaleCount,i),[a,u]=L.useState(null);L.useLayoutEffect(()=>{u(null)},[c]);const l=a??c,m=h=>{const p=Math.min(t.maxScaleCount,h);u(p)},[f,g]=L.useState(A.START_CURSOR_TIME),w=L.useRef(A.START_CURSOR_TIME);No({scrollElementRef:r,scale:t.scale,scaleWidth:t.scaleWidth,startLeft:t.startLeft,cursorTimeRef:w});const S=h=>{t.onChange?.(h)},y=h=>{let{left:p,time:v}=h;return typeof v<"u"?(g(v),w.current=v,!0):typeof p<"u"?(g(w.current=A.parserPixelToTime(p,{startLeft:t.startLeft,scale:t.scale,scaleWidth:t.scaleWidth})),!0):!1},_=(h,p={})=>{const v=r.current;if(!v)return;const{block:R="start",offset:E=0}=p,C=A.parserTimeToPixel(h,{startLeft:t.startLeft,scale:t.scale,scaleWidth:t.scaleWidth}),z=v.clientWidth;let D;R==="end"?D=C-z+E:R==="center"?D=C-z/2:D=C-E;const j=Math.max(0,v.scrollWidth-z);v.scrollLeft=Math.min(Math.max(D,0),j)};return L.useImperativeHandle(n,()=>({get target(){return r.current},set time(h){y({time:h})},get time(){return w.current},getTime(){return w.current},setTime(h){y({time:h})},setScrollLeft:h=>{r.current&&(r.current.scrollLeft=h)},setScrollTop:h=>{r.current&&(r.current.scrollTop=h)},get scrollLeft(){return r.current?r.current.scrollLeft:0},get scrollTop(){return r.current?r.current.scrollTop:0},set scrollLeft(h){r.current&&(r.current.scrollLeft=h)},set scrollTop(h){r.current&&(r.current.scrollTop=h)},scrollToTime:_})),T.jsxs(Bs,{style:t.style,className:`${A.PREFIX} ${t.disableDrag?A.PREFIX+"-disable":""}`,"data-slot":"scroll-area",children:[T.jsxs(Xs,{"data-slot":"scroll-area-viewport",ref:r,onScroll:h=>{t.onScroll?.(h.currentTarget)},children:[T.jsx(vo,{...t,setCursor:y,scaleCount:l,scrollElementRef:r}),T.jsx(go,{...t,scrollElementRef:r,timelineWidth:s,timelineHeight:o,disableDrag:t.disableDrag,editorData:t.editorData,cursorTime:f,scaleCount:l,setScaleCount:m,setEditorData:S}),!t.hideCursor&&T.jsx(Do,{...t,timelineWidth:s,height:o,scaleCount:l,setScaleCount:m,setCursor:y,cursorTime:f,editorData:t.editorData,scrollElementRef:r})]}),T.jsx(kn,{orientation:"horizontal"}),T.jsx(kn,{orientation:"vertical"}),T.jsx(Ys,{})]})}exports.Timeline=Io;
13
+ color: hsl(${Math.max(0,Math.min(120-120*T,120))}deg 100% 31%);`,t?.key)}return(u=t?.onChange)==null||u.call(t,s),s}return o.updateDeps=i=>{r=i},o}function kn(n,e){if(n===void 0)throw new Error("Unexpected undefined");return n}const ao=(n,e)=>Math.abs(n-e)<1.01,co=(n,e,t)=>{let r;return function(...s){n.clearTimeout(r),r=n.setTimeout(()=>e.apply(this,s),t)}},Wn=n=>{const{offsetWidth:e,offsetHeight:t}=n;return{width:e,height:t}},lo=n=>n,uo=n=>{const e=Math.max(n.startIndex-n.overscan,0),t=Math.min(n.endIndex+n.overscan,n.count-1),r=[];for(let s=e;s<=t;s++)r.push(s);return r},fo=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;const s=i=>{const{width:a,height:c}=i;e({width:Math.round(a),height:Math.round(c)})};if(s(Wn(t)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const a=()=>{const c=i[0];if(c?.borderBoxSize){const u=c.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(Wn(t))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},zn={passive:!0},jn=typeof window>"u"?!0:"onscrollend"in window,ho=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;let s=0;const o=n.options.useScrollendEvent&&jn?()=>{}:co(r,()=>{e(s,!1)},n.options.isScrollingResetDelay),i=l=>()=>{const{horizontal:m,isRtl:f}=n.options;s=m?t.scrollLeft*(f&&-1||1):t.scrollTop,o(),e(s,l)},a=i(!0),c=i(!1);c(),t.addEventListener("scroll",a,zn);const u=n.options.useScrollendEvent&&jn;return u&&t.addEventListener("scrollend",c,zn),()=>{t.removeEventListener("scroll",a),u&&t.removeEventListener("scrollend",c)}},mo=(n,e,t)=>{if(e?.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return n[t.options.horizontal?"offsetWidth":"offsetHeight"]},po=(n,{adjustments:e=0,behavior:t},r)=>{var s,o;const i=n+e;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:i,behavior:t})};class go{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const i=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var o;return(o=r())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=r())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,s])=>{typeof s>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:lo,rangeExtractor:uo,onChange:()=>{},measureElement:mo,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=Dt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const s=new Map,o=new Map;for(let i=r-1;i>=0;i--){const a=t[i];if(s.has(a.lane))continue;const c=o.get(a.lane);if(c==null||a.end>c.end?o.set(a.lane,a):a.end<c.end&&s.set(a.lane,!0),s.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,a)=>i.end===a.end?i.index-a.index:i.end-a.end)[0]:void 0},this.getMeasurementOptions=Dt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,r,s,o,i)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i}),{key:!1}),this.getMeasurements=Dt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i},a)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(l=>{this.itemSizeCache.set(l.key,l.size)}));const c=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,c);for(let l=c;l<t;l++){const m=o(l),f=this.options.lanes===1?u[l-1]:this.getFurthestMeasurement(u,l),p=f?f.end+this.options.gap:r+s,S=a.get(m),_=typeof S=="number"?S:this.options.estimateSize(l),T=p+_,w=f?f.lane:l%this.options.lanes;u[l]={index:l,start:p,size:_,end:T,key:m,lane:w}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Dt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,o)=>this.range=t.length>0&&r>0?vo({measurements:t,outerSize:r,scrollOffset:s,lanes:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Dt(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,o,i)=>o===null||i===null?[]:t({startIndex:o,endIndex:i,overscan:r,count:s}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const s=this.indexFromElement(t),o=this.measurementsCache[s];if(!o)return;const i=o.key,a=this.elementsCache.get(i);a!==t&&(a&&this.observer.unobserve(a),this.observer.observe(t),this.elementsCache.set(i,t)),t.isConnected&&this.resizeItem(s,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const s=this.measurementsCache[t];if(!s)return;const o=this.itemSizeCache.get(s.key)??s.size,i=r-o;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,i,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(t,void 0)},this.getVirtualItems=Dt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let o=0,i=t.length;o<i;o++){const a=t[o],c=r[a];s.push(c)}return s},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return kn(r[hr(0,r.length-1,s=>kn(r[s]).start,t)])},this.getOffsetForAlignment=(t,r,s=0)=>{const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=t>=i+o?"end":"start"),r==="center"?t+=(s-o)/2:r==="end"&&(t-=o);const a=this.getTotalSize()+this.options.scrollMargin-o;return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.measurementsCache[t];if(!s)return;const o=this.getSize(),i=this.getScrollOffset();if(r==="auto")if(s.end>=i+o-this.options.scrollPaddingEnd)r="end";else if(s.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];const a=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:r="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(t,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let o=0;const i=10,a=u=>{if(!this.targetWindow)return;const l=this.getOffsetForIndex(t,u);if(!l){console.warn("Failed to get offset for index:",t);return}const[m,f]=l;this._scrollToOffset(m,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const p=this.getScrollOffset(),S=this.getOffsetForIndex(t,f);if(!S){console.warn("Failed to get offset for index:",t);return}ao(S[0],p)||c(f)})},c=u=>{this.targetWindow&&(o++,o<i?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",o,i),this.targetWindow.requestAnimationFrame(()=>a(u))):console.warn(`Failed to scroll to index ${t} after ${i} attempts.`))};a(r)},this.scrollBy=(t,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((t=r[r.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(a=>a===null);){const a=r[i];o[a.lane]===null&&(o[a.lane]=a.end),i--}s=Math.max(...o.filter(a=>a!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const hr=(n,e,t,r)=>{for(;n<=e;){const s=(n+e)/2|0,o=t(s);if(o<r)n=s+1;else if(o>r)e=s-1;else return s}return n>0?n-1:0};function vo({measurements:n,outerSize:e,scrollOffset:t,lanes:r}){const s=n.length-1,o=c=>n[c].start;if(n.length<=r)return{startIndex:0,endIndex:s};let i=hr(0,s,o,t),a=i;if(r===1)for(;a<s&&n[a].end<t+e;)a++;else if(r>1){const c=Array(r).fill(0);for(;a<s&&c.some(l=>l<t+e);){const l=n[a];c[l.lane]=l.end,a++}const u=Array(r).fill(t+e);for(;i>=0&&u.some(l=>l>=t);){const l=n[i];u[l.lane]=l.start,i--}i=Math.max(0,i-i%r),a=Math.min(s,a+(r-1-a%r))}return{startIndex:i,endIndex:a}}const Fn=typeof document<"u"?g.useLayoutEffect:g.useEffect;function bo(n){const e=g.useReducer(()=>({}),{})[1],t={...n,onChange:(s,o)=>{var i;o?gr.flushSync(e):e(),(i=n.onChange)==null||i.call(n,s,o)}},[r]=g.useState(()=>new go(t));return r.setOptions(t),Fn(()=>r._didMount(),[]),Fn(()=>r._willUpdate()),r}function mr(n){return bo({observeElementRect:fo,observeElementOffset:ho,scrollToFn:po,...n})}const So=n=>{const{rowData:e,style:t={},onClickRow:r,onDoubleClickRow:s,onContextMenuRow:o,scrollContainerRef:i,startLeft:a,scale:c,scaleWidth:u,unstable_rowActionsOverscan:l}=n,m=["edit-row"];e?.selected&&m.push("edit-row-selected");const f=c??D.DEFAULT_SCALE,p=u??D.DEFAULT_SCALE_WIDTH,S=a??D.DEFAULT_START_LEFT,_=h=>{if(!i.current)return 0;const R=h.currentTarget.getBoundingClientRect(),P=h.clientX-R.x;return D.parserPixelToTime(P,{startLeft:S,scale:f,scaleWidth:p})},T=O.useMemo(()=>(e?.actions?[...e.actions]:[]).sort((h,v)=>h.start-v.start),[e]),w=O.useCallback(h=>T[h]?.id??h,[T]),b=mr({horizontal:!0,count:T.length,getItemKey:w,getScrollElement:()=>i.current,estimateSize:h=>{if(!T[h])return 0;let v=h>0?T[h-1].end:0,R=T[h].end;if(v>R)return 0;let{width:y}=D.parserTimeToTransform({start:v,end:R},{startLeft:S,scale:f,scaleWidth:p});return y},overscan:l??5});return O.useEffect(()=>b.measure(),[f,p,S,b]),C.jsx("div",{className:`${ve(...m)} ${(e?.classNames||[]).join(" ")}`,style:t,onClick:h=>{if(e&&r){const v=_(h);r(h,{row:e,time:v})}},onDoubleClick:h=>{if(e&&s){const v=_(h);s(h,{row:e,time:v})}},onContextMenu:h=>{if(e&&o){const v=_(h);o(h,{row:e,time:v})}},children:e&&b.getVirtualItems().map(h=>{const v=T[h.index];if(!v)throw new Error("Action not found");return C.jsx(io,{...n,handleTime:_,row:e,action:v},v.id)})})},_o=n=>{const e=De.c(20);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={isMoving:!1,movePositions:[],assistPositions:[]},e[0]=t):t=e[0];const[r,s]=O.useState(t),o=O.useRef(null);let i;e[1]!==n||e[2]!==r?(i=()=>({...n,snapData:r}),e[1]=n,e[2]=r,e[3]=i):i=e[3];const a=O.useEffectEvent(i);let c;e[4]!==a?(c=()=>{const w=o.current,b=a();if(b.snap&&w&&b.snapData.isMoving&&b.snapPositions){const h=w.assistActionIds,v=b.snapPositions.filter(R=>!(R.actionId===w.action.id||h&&!h.includes(R.actionId))).map(wo);if(!b.hideCursor){const R=D.parserTimeToPixel(b.cursorTime,{scaleWidth:b.scaleWidth??160,scale:b.scale??1,startLeft:b.startLeft??20});v.push(R)}s(R=>({...R,assistPositions:v}))}else!b.snap&&b.snapData.isMoving&&s(Eo)},e[4]=a,e[5]=c):c=e[5];let u;e[6]!==n.snap?(u=[n.snap],e[6]=n.snap,e[7]=u):u=e[7],O.useEffect(c,u);let l;e[8]!==n?(l=w=>{const b=n.getAssistDragLineActionIds&&n.getAssistDragLineActionIds({action:w.action,row:w.row,editorData:n.editorData});if(o.current={action:w.action,row:w.row,assistActionIds:b},n.snap&&n.snapPositions){const h=n.snapPositions.filter(v=>!(v.actionId===w.action.id||b&&!b.includes(v.actionId))).map(yo);if(!n.hideCursor){const v=D.parserTimeToPixel(n.cursorTime,{scaleWidth:n.scaleWidth??160,scale:n.scale??1,startLeft:n.startLeft??20});h.push(v)}s({isMoving:!0,movePositions:[],assistPositions:h})}else s({isMoving:!0,movePositions:[],assistPositions:[]})},e[8]=n,e[9]=l):l=e[9];const m=l;let f;e[10]!==n.scale||e[11]!==n.scaleWidth||e[12]!==n.snap||e[13]!==n.startLeft?(f=w=>{if(n.snap){const b=n.scaleWidth??160,h=n.scale??1,v=n.startLeft??20,{left:R,width:y}=D.parserTimeToTransform({start:w.start,end:w.end},{startLeft:v,scaleWidth:b,scale:h}),P=w.dir?w.dir==="right"?[R+y]:[R]:[R,R+y];s(M=>({...M,movePositions:P}))}},e[10]=n.scale,e[11]=n.scaleWidth,e[12]=n.snap,e[13]=n.startLeft,e[14]=f):f=e[14];const p=f;let S;e[15]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{o.current=null,s({isMoving:!1,movePositions:[],assistPositions:[]})},e[15]=S):S=e[15];const _=S;let T;return e[16]!==m||e[17]!==p||e[18]!==r?(T={snapData:r,handleInitSnap:m,handleUpdateSnap:p,disposeSnap:_},e[16]=m,e[17]=p,e[18]=r,e[19]=T):T=e[19],T};function wo(n){return n.value}function Eo(n){return{...n,assistPositions:[]}}function yo(n){return n.value}const To=n=>{const e=De.c(34);let t,r;e[0]!==n?({ref:r,...t}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t.cursorTime||e[4]!==t.editorData||e[5]!==t.getAssistDragLineActionIds||e[6]!==t.hideCursor||e[7]!==t.scale||e[8]!==t.scaleWidth||e[9]!==t.snap||e[10]!==t.snapPositions||e[11]!==t.startLeft?(s={snap:t.snap,hideCursor:t.hideCursor,cursorTime:t.cursorTime,scaleWidth:t.scaleWidth,scale:t.scale,startLeft:t.startLeft,getAssistDragLineActionIds:t.getAssistDragLineActionIds,editorData:t.editorData,snapPositions:t.snapPositions},e[3]=t.cursorTime,e[4]=t.editorData,e[5]=t.getAssistDragLineActionIds,e[6]=t.hideCursor,e[7]=t.scale,e[8]=t.scaleWidth,e[9]=t.snap,e[10]=t.snapPositions,e[11]=t.startLeft,e[12]=s):s=e[12];const{snapData:o,handleInitSnap:i,handleUpdateSnap:a,disposeSnap:c}=_o(s),u=t.rowHeight??32,l=t.scaleWidth??160,m=t.startLeft??20,f=Math.max(t.scaleCount*l+m,t.timelineWidth);let p;if(e[13]!==f||e[14]!==u||e[15]!==c||e[16]!==i||e[17]!==a||e[18]!==t||e[19]!==o){const R=[];let y=0;for(let P=0;P<t.editorData.length;P++){const M=t.editorData[P];if(!M)continue;const x=M.rowHeight||u;R.push(O.createElement(So,{...t,key:M.id,rowData:M,snapData:o,scrollContainerRef:t.scrollElementRef,style:{position:"absolute",top:0,left:0,width:f,height:`${x}px`,transform:`translateY(${y}px)`},onActionMoveStart:E=>(i(E),t.onActionMoveStart&&t.onActionMoveStart(E)),onActionResizeStart:E=>(i(E),t.onActionResizeStart&&t.onActionResizeStart(E)),onActionMoving:E=>(a(E),t.onActionMoving&&t.onActionMoving(E)),onActionResizing:E=>(a(E),t.onActionResizing&&t.onActionResizing(E)),onActionResizeEnd:E=>(c(),t.onActionResizeEnd&&t.onActionResizeEnd(E)),onActionMoveEnd:E=>(c(),t.onActionMoveEnd&&t.onActionMoveEnd(E))})),y=y+x}p=[y,R],e[13]=f,e[14]=u,e[15]=c,e[16]=i,e[17]=a,e[18]=t,e[19]=o,e[20]=p}else p=e[20];const[S,_]=p,T=`0, ${t.startLeft??20}px`,w=`${t.startLeft??20}px, ${t.scaleWidth??160}px`;let b;e[21]!==f||e[22]!==T||e[23]!==w||e[24]!==S?(b={width:f,height:S,position:"relative",backgroundPositionX:T,backgroundSize:w},e[21]=f,e[22]=T,e[23]=w,e[24]=S,e[25]=b):b=e[25];let h;e[26]!==t.snap||e[27]!==o?(h=t.snap&&C.jsx(Lr,{...o}),e[26]=t.snap,e[27]=o,e[28]=h):h=e[28];let v;return e[29]!==r||e[30]!==_||e[31]!==b||e[32]!==h?(v=C.jsxs("div",{ref:r,style:b,className:"timeline-editor-edit-area",children:[_,h]}),e[29]=r,e[30]=_,e[31]=b,e[32]=h,e[33]=v):v=e[33],v};function Ro({scaleSplitCount:n,scaleWidth:e,startLeft:t,scaleCount:r,maxScaleCount:s,scale:o,scrollElementRef:i,onClickTimeArea:a,setCursor:c,getScaleRender:u}){const l=n??1,m=e??160,f=t??20,p=(n??0)>0,S=p?r*(n??1)+1:r,_=(p?m/l:m)*(S-1)+f,w=mr({horizontal:!0,count:S,getScrollElement:()=>i.current,estimateSize:b=>{switch(b){case 0:return f;default:return p?m/l:m}},overscan:10});return O.useEffect(()=>w.measure(),[o,e,t,w]),C.jsx("div",{style:{width:`${_}px`},className:ve("time-area"),onClick:b=>{const h=t??20,v=e??160,R=o??1,y=s??1/0,P=b.currentTarget.getBoundingClientRect(),M=b.clientX-P.x,x=Math.max(M,h);if(x>y*v+h)return;const E=D.parserPixelToTime(x,{startLeft:h,scale:R,scaleWidth:v});a&&a(E,b),!b.defaultPrevented&&c({time:E})},children:w.getVirtualItems().map(b=>{const h=b.index,v=n??1,R=o??1,y=p?h%v===0:!0,P=[ve("time-unit"),ve(y?"time-unit-big":"time-unit-small")],M=(p?h/v:h)*R;return C.jsx("div",{"data-index":b.index,style:{width:`${b.size}px`,transform:`translateX(${b.start}px)`},className:P.join(" "),children:y&&C.jsx("div",{className:ve("time-unit-scale"),children:u?.(M)??M})},b.key)})})}function xo(n){return typeof n=="object"&&n!==null}function Ao(n,e,t){if(n instanceof EventTarget)return[n];if(typeof n=="string"){const s=document.querySelectorAll(n);return s?Array.from(s):[]}return Array.from(n)}function Co(n){return xo(n)&&"ownerSVGElement"in n}const Ht=new WeakMap;let Bt;const pr=(n,e,t)=>(r,s)=>s&&s[0]?s[0][n+"Size"]:Co(r)&&"getBBox"in r?r.getBBox()[e]:r[t],Do=pr("inline","width","offsetWidth"),Po=pr("block","height","offsetHeight");function Lo({target:n,borderBoxSize:e}){Ht.get(n)?.forEach(t=>{t(n,{get width(){return Do(n,e)},get height(){return Po(n,e)}})})}function Oo(n){n.forEach(Lo)}function Mo(){typeof ResizeObserver>"u"||(Bt=new ResizeObserver(Oo))}function Io(n,e){Bt||Mo();const t=Ao(n);return t.forEach(r=>{let s=Ht.get(r);s||(s=new Set,Ht.set(r,s)),s.add(e),Bt?.observe(r)}),()=>{t.forEach(r=>{const s=Ht.get(r);s?.delete(e),s?.size||Bt?.unobserve(r)})}}const Xt=new Set;let Pt;function No(){Pt=()=>{const n={get width(){return window.innerWidth},get height(){return window.innerHeight}};Xt.forEach(e=>e(n))},window.addEventListener("resize",Pt)}function ko(n){return Xt.add(n),Pt||No(),()=>{Xt.delete(n),!Xt.size&&typeof Pt=="function"&&(window.removeEventListener("resize",Pt),Pt=void 0)}}function Wo(n,e){return typeof n=="function"?ko(n):Io(n,e)}function zo(n){const e=De.c(4),{elementRef:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={width:0,height:0},e[0]=r):r=e[0];const[s,o]=O.useState(r);let i,a;return e[1]!==t?(i=()=>{t.current&&Wo(t.current,(c,u)=>{o({width:u.width,height:u.height})})},a=[t],e[1]=t,e[2]=i,e[3]=a):(i=e[2],a=e[3]),O.useLayoutEffect(i,a),s}const jo=n=>{const e=De.c(49),{disableDrag:t,cursorTime:r,setCursor:s,startLeft:o,scaleWidth:i,scale:a,scaleCount:c,scaleSplitCount:u,scrollElementRef:l,maxScaleCount:m,onCursorDragStart:f,onCursorDrag:p,onCursorDragEnd:S,cursorSnap:_,autoScrollSpeed:T,autoScrollMaxSpeed:w,snapPositions:b}=n;let h;e[0]!==b?(h=b===void 0?[]:b,e[0]=b,e[1]=h):h=e[1];const v=h,R=O.useRef(null),y=o??20,P=i??160,M=a??1;let x;e[2]!==_||e[3]!==v?(x=_?v:[],e[2]=_,e[3]=v,e[4]=x):x=e[4];const E=x;let W,J;e[5]!==r||e[6]!==a||e[7]!==i||e[8]!==o?(W=()=>{if(R.current){const te=o??20,U=i??160,se=a??1;R.current.updateLeft(D.parserTimeToPixel(r,{startLeft:te,scaleWidth:U,scale:se}))}},J=[r,o,i,a],e[5]=r,e[6]=a,e[7]=i,e[8]=o,e[9]=W,e[10]=J):(W=e[9],J=e[10]),O.useEffect(W,J);const Z=m??1/0,K=(u??0)>0,ie=u??1,k=K?c*(u??1)+1:c,Y=o??20,Q=(K?P/ie:P)*(k-1)+Y;let j;e[11]!==y||e[12]!==Z||e[13]!==l||e[14]!==Q||e[15]!==P?(j=()=>({left:0,right:Math.min(Q,Z*P+y-(l.current?.scrollLeft??0))}),e[11]=y,e[12]=Z,e[13]=l,e[14]=Q,e[15]=P,e[16]=j):j=e[16];const I=!t;let d;e[17]!==r||e[18]!==y||e[19]!==f||e[20]!==M||e[21]!==P?(d=()=>{const te=R.current?.getLeft()??D.parserTimeToPixel(r,{startLeft:y,scaleWidth:P,scale:M}),U=D.parserPixelToTime(te,{startLeft:y,scale:M,scaleWidth:P});f&&f(U)},e[17]=r,e[18]=y,e[19]=f,e[20]=M,e[21]=P,e[22]=d):d=e[22];let A;e[23]!==y||e[24]!==S||e[25]!==M||e[26]!==s||e[27]!==P?(A=te=>{const{left:U}=te,se=D.parserPixelToTime(U,{startLeft:y,scale:M,scaleWidth:P});s({time:se}),S&&S(se)},e[23]=y,e[24]=S,e[25]=M,e[26]=s,e[27]=P,e[28]=A):A=e[28];let L;e[29]!==y||e[30]!==p||e[31]!==M||e[32]!==s||e[33]!==P?(L=te=>{const{left:U}=te,se=D.parserPixelToTime(U,{startLeft:y,scale:M,scaleWidth:P});s({time:se}),p&&p(se)},e[29]=y,e[30]=p,e[31]=M,e[32]=s,e[33]=P,e[34]=L):L=e[34];let F,me;e[35]===Symbol.for("react.memo_cache_sentinel")?(F=ve("cursor"),me=ve("cursor-top"),e[35]=F,e[36]=me):(F=e[35],me=e[36]);let ge;e[37]===Symbol.for("react.memo_cache_sentinel")?(ge=C.jsxs("div",{className:F,children:[C.jsx("svg",{className:me,width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",children:C.jsx("path",{d:"M0 1C0 0.447715 0.447715 0 1 0H7C7.55228 0 8 0.447715 8 1V9.38197C8 9.76074 7.786 10.107 7.44721 10.2764L4.44721 11.7764C4.16569 11.9172 3.83431 11.9172 3.55279 11.7764L0.552786 10.2764C0.214002 10.107 0 9.76074 0 9.38197V1Z",fill:"currentColor"})}),C.jsx("div",{className:ve("cursor-area")})]}),e[37]=ge):ge=e[37];let X;return e[38]!==E||e[39]!==w||e[40]!==T||e[41]!==y||e[42]!==l||e[43]!==L||e[44]!==j||e[45]!==I||e[46]!==d||e[47]!==A?(X=C.jsx(dr,{start:y,ref:R,parentRef:l,getBounds:j,autoScroll:!0,autoScrollSpeed:T,autoScrollMaxSpeed:w,enableDragging:I,enableResizing:!1,snapPositions:E,snapDistance:D.DEFAULT_SNAP_DISTANCE,snapOrigin:"left",onDragStart:d,onDragEnd:A,onDrag:L,children:ge}),e[38]=E,e[39]=w,e[40]=T,e[41]=y,e[42]=l,e[43]=L,e[44]=j,e[45]=I,e[46]=d,e[47]=A,e[48]=X):X=e[48],X};function Un(n){const e=De.c(9);let t,r,s;e[0]!==n?({className:t,orientation:s,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);const o=s===void 0?"vertical":s;let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=C.jsx(ar,{"data-slot":"scroll-area-thumb"}),e[4]=i):i=e[4];let a;return e[5]!==t||e[6]!==o||e[7]!==r?(a=C.jsx(rr,{"data-slot":"scroll-area-scrollbar",orientation:o,className:t,...r,children:i}),e[5]=t,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function Fo(n){const e=De.c(7),{scrollElementRef:t,scale:r,scaleWidth:s,startLeft:o,cursorTimeRef:i}=n,a=O.useRef(null),c=O.useRef(null);let u,l;e[0]!==i||e[1]!==r||e[2]!==s||e[3]!==t||e[4]!==o?(u=()=>{const m=t.current;if(a.current!==null&&c.current!==null&&m&&(a.current!==r||c.current!==s)){const f=m.scrollLeft,p=i.current,S=D.parserTimeToPixel(p,{startLeft:o,scale:a.current,scaleWidth:c.current}),_=D.parserTimeToPixel(p,{startLeft:o,scale:r,scaleWidth:s}),T=S-f,w=_-T;m.scrollLeft=w}a.current=r,c.current=s},l=[r,s,o,t,i],e[0]=i,e[1]=r,e[2]=s,e[3]=t,e[4]=o,e[5]=u,e[6]=l):(u=e[5],l=e[6]),O.useLayoutEffect(u,l)}function Uo({ref:n,...e}){const t=xr(e),r=O.useRef(null),{width:s,height:o}=zo({elementRef:r}),i=t.minScaleCount??Math.max(D.getScaleCountByRows(t.editorData,{scale:t.scale,pad:.1}),Math.ceil((s-t.startLeft)/t.scaleWidth)),a=Math.min(t.maxScaleCount,i),c=t.editorData?D.parserActionsToPositions(t.editorData.flatMap(h=>h.actions),{startLeft:t.startLeft,scale:t.scale,scaleWidth:t.scaleWidth}):[],[u,l]=O.useState(null);O.useLayoutEffect(()=>{l(null)},[a]);const m=u??a,f=h=>{const v=Math.min(t.maxScaleCount,h);l(v)},[p,S]=O.useState(D.START_CURSOR_TIME),_=O.useRef(D.START_CURSOR_TIME);Fo({scrollElementRef:r,scale:t.scale,scaleWidth:t.scaleWidth,startLeft:t.startLeft,cursorTimeRef:_});const T=h=>{t.onChange?.(h)},w=h=>{let{left:v,time:R}=h;return typeof R<"u"?(S(R),_.current=R,!0):typeof v<"u"?(S(_.current=D.parserPixelToTime(v,{startLeft:t.startLeft,scale:t.scale,scaleWidth:t.scaleWidth})),!0):!1},b=(h,v={})=>{const R=r.current;if(!R)return;const{block:y="start",offset:P=0,onlyIfNotVisible:M=!1}=v,x=D.parserTimeToPixel(h,{startLeft:t.startLeft,scale:t.scale,scaleWidth:t.scaleWidth}),E=R.clientWidth;if(M){const Z=R.scrollLeft;if(x>=Z&&x<=Z+E)return}let W;y==="end"?W=x-E+P:y==="center"?W=x-E/2:W=x-P;const J=Math.max(0,R.scrollWidth-E);R.scrollTo({left:Math.min(Math.max(W,0),J),behavior:v.behavior??"instant"})};return O.useImperativeHandle(n,()=>({get target(){return r.current},set time(h){w({time:h})},get time(){return _.current},getTime(){return _.current},setTime(h){w({time:h})},getTimePixelPosition(h){return D.parserTimeToPixel(h??_.current,{startLeft:t.startLeft,scale:t.scale,scaleWidth:t.scaleWidth})},setScrollLeft:h=>{r.current&&(r.current.scrollLeft=h)},setScrollTop:h=>{r.current&&(r.current.scrollTop=h)},get scrollLeft(){return r.current?r.current.scrollLeft:0},get scrollTop(){return r.current?r.current.scrollTop:0},set scrollLeft(h){r.current&&(r.current.scrollLeft=h)},set scrollTop(h){r.current&&(r.current.scrollTop=h)},scrollToTime:b})),C.jsxs(Zs,{style:t.style,className:`${D.PREFIX} ${t.disableDrag?D.PREFIX+"-disable":""}`,"data-slot":"scroll-area",children:[C.jsxs(Qs,{"data-slot":"scroll-area-viewport",ref:r,onScroll:h=>{t.onScroll?.(h.currentTarget)},children:[C.jsx(Ro,{...t,setCursor:w,scaleCount:m,scrollElementRef:r}),C.jsx(To,{...t,scrollElementRef:r,timelineWidth:s,timelineHeight:o,disableDrag:t.disableDrag,editorData:t.editorData,cursorTime:p,scaleCount:m,setScaleCount:f,setEditorData:T,snapPositions:c}),!t.hideCursor&&C.jsx(jo,{...t,timelineWidth:s,height:o,scaleCount:m,setScaleCount:f,setCursor:w,cursorTime:p,editorData:t.editorData,scrollElementRef:r,snapPositions:c})]}),C.jsx(Un,{orientation:"horizontal"}),C.jsx(Un,{orientation:"vertical"}),C.jsx(eo,{})]})}exports.Timeline=Uo;