UNPKG

react-timeline-scheduler

Version:

A highly customizable timeline scheduler for managing production tasks in React applications.

39 lines (37 loc) 217 kB
(function(p,Bt){typeof exports=="object"&&typeof module<"u"?module.exports=Bt(require("react")):typeof define=="function"&&define.amd?define(["react"],Bt):(p=typeof globalThis<"u"?globalThis:p||self,p["react-timeline-scheduler"]=Bt(p.React))})(this,function(p){"use strict";function Bt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const gs=Bt(p);var Dn={exports:{}},Ht={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var lr;function Tu(){if(lr)return Ht;lr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,i,r){var o=null;if(r!==void 0&&(o=""+r),i.key!==void 0&&(o=""+i.key),"key"in i){r={};for(var a in i)a!=="key"&&(r[a]=i[a])}else r=i;return i=r.ref,{$$typeof:e,type:s,key:o,ref:i!==void 0?i:null,props:r}}return Ht.Fragment=t,Ht.jsx=n,Ht.jsxs=n,Ht}var $t={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ur;function _u(){return ur||(ur=1,process.env.NODE_ENV!=="production"&&function(){function e(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===me?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case E:return"Fragment";case D:return"Portal";case b:return"Profiler";case A:return"StrictMode";case le:return"Suspense";case be:return"SuspenseList"}if(typeof h=="object")switch(typeof h.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),h.$$typeof){case Y:return(h.displayName||"Context")+".Provider";case R:return(h._context.displayName||"Context")+".Consumer";case se:var k=h.render;return h=h.displayName,h||(h=k.displayName||k.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case F:return k=h.displayName||null,k!==null?k:e(h.type)||"Memo";case he:k=h._payload,h=h._init;try{return e(h(k))}catch{}}return null}function t(h){return""+h}function n(h){try{t(h);var k=!1}catch{k=!0}if(k){k=console;var C=k.error,H=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return C.call(k,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",H),t(h)}}function s(){}function i(){if(Tn===0){du=console.log,fu=console.info,hu=console.warn,mu=console.error,pu=console.group,gu=console.groupCollapsed,yu=console.groupEnd;var h={configurable:!0,enumerable:!0,value:s,writable:!0};Object.defineProperties(console,{info:h,log:h,warn:h,error:h,group:h,groupCollapsed:h,groupEnd:h})}Tn++}function r(){if(Tn--,Tn===0){var h={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ie({},h,{value:du}),info:ie({},h,{value:fu}),warn:ie({},h,{value:hu}),error:ie({},h,{value:mu}),group:ie({},h,{value:pu}),groupCollapsed:ie({},h,{value:gu}),groupEnd:ie({},h,{value:yu})})}0>Tn&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function o(h){if(rr===void 0)try{throw Error()}catch(C){var k=C.stack.trim().match(/\n( *(at )?)/);rr=k&&k[1]||"",vu=-1<C.stack.indexOf(` at`)?" (<anonymous>)":-1<C.stack.indexOf("@")?"@unknown:0:0":""}return` `+rr+h+vu}function a(h,k){if(!h||or)return"";var C=ar.get(h);if(C!==void 0)return C;or=!0,C=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var H=null;H=Z.H,Z.H=null,i();try{var pe={DetermineComponentFrameRoot:function(){try{if(k){var ct=function(){throw Error()};if(Object.defineProperty(ct.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ct,[])}catch(tt){var ps=tt}Reflect.construct(h,[],ct)}else{try{ct.call()}catch(tt){ps=tt}h.call(ct.prototype)}}else{try{throw Error()}catch(tt){ps=tt}(ct=h())&&typeof ct.catch=="function"&&ct.catch(function(){})}}catch(tt){if(tt&&ps&&typeof tt.stack=="string")return[tt.stack,ps.stack]}return[null,null]}};pe.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var ee=Object.getOwnPropertyDescriptor(pe.DetermineComponentFrameRoot,"name");ee&&ee.configurable&&Object.defineProperty(pe.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var L=pe.DetermineComponentFrameRoot(),et=L[0],Ut=L[1];if(et&&Ut){var ve=et.split(` `),St=Ut.split(` `);for(L=ee=0;ee<ve.length&&!ve[ee].includes("DetermineComponentFrameRoot");)ee++;for(;L<St.length&&!St[L].includes("DetermineComponentFrameRoot");)L++;if(ee===ve.length||L===St.length)for(ee=ve.length-1,L=St.length-1;1<=ee&&0<=L&&ve[ee]!==St[L];)L--;for(;1<=ee&&0<=L;ee--,L--)if(ve[ee]!==St[L]){if(ee!==1||L!==1)do if(ee--,L--,0>L||ve[ee]!==St[L]){var _n=` `+ve[ee].replace(" at new "," at ");return h.displayName&&_n.includes("<anonymous>")&&(_n=_n.replace("<anonymous>",h.displayName)),typeof h=="function"&&ar.set(h,_n),_n}while(1<=ee&&0<=L);break}}}finally{or=!1,Z.H=H,r(),Error.prepareStackTrace=C}return ve=(ve=h?h.displayName||h.name:"")?o(ve):"",typeof h=="function"&&ar.set(h,ve),ve}function l(h){if(h==null)return"";if(typeof h=="function"){var k=h.prototype;return a(h,!(!k||!k.isReactComponent))}if(typeof h=="string")return o(h);switch(h){case le:return o("Suspense");case be:return o("SuspenseList")}if(typeof h=="object")switch(h.$$typeof){case se:return h=a(h.render,!1),h;case F:return l(h.type);case he:k=h._payload,h=h._init;try{return l(h(k))}catch{}}return""}function u(){var h=Z.A;return h===null?null:h.getOwner()}function c(h){if(oe.call(h,"key")){var k=Object.getOwnPropertyDescriptor(h,"key").get;if(k&&k.isReactWarning)return!1}return h.key!==void 0}function d(h,k){function C(){xu||(xu=!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)",k))}C.isReactWarning=!0,Object.defineProperty(h,"key",{get:C,configurable:!0})}function f(){var h=e(this.type);return wu[h]||(wu[h]=!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.")),h=this.props.ref,h!==void 0?h:null}function m(h,k,C,H,pe,ee){return C=ee.ref,h={$$typeof:N,type:h,key:k,props:ee,_owner:pe},(C!==void 0?C:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:f}):Object.defineProperty(h,"ref",{enumerable:!1,value:null}),h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(h,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function g(h,k,C,H,pe,ee){if(typeof h=="string"||typeof h=="function"||h===E||h===b||h===A||h===le||h===be||h===ue||typeof h=="object"&&h!==null&&(h.$$typeof===he||h.$$typeof===F||h.$$typeof===Y||h.$$typeof===R||h.$$typeof===se||h.$$typeof===Re||h.getModuleId!==void 0)){var L=k.children;if(L!==void 0)if(H)if(bn(L)){for(H=0;H<L.length;H++)y(L[H],h);Object.freeze&&Object.freeze(L)}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 y(L,h)}else L="",(h===void 0||typeof h=="object"&&h!==null&&Object.keys(h).length===0)&&(L+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),h===null?H="null":bn(h)?H="array":h!==void 0&&h.$$typeof===N?(H="<"+(e(h.type)||"Unknown")+" />",L=" Did you accidentally export a JSX literal instead of a component?"):H=typeof h,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",H,L);if(oe.call(k,"key")){L=e(h);var et=Object.keys(k).filter(function(ve){return ve!=="key"});H=0<et.length?"{key: someKey, "+et.join(": ..., ")+": ...}":"{key: someKey}",Su[L+H]||(et=0<et.length?"{"+et.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,H,L,et,L),Su[L+H]=!0)}if(L=null,C!==void 0&&(n(C),L=""+C),c(k)&&(n(k.key),L=""+k.key),"key"in k){C={};for(var Ut in k)Ut!=="key"&&(C[Ut]=k[Ut])}else C=k;return L&&d(C,typeof h=="function"?h.displayName||h.name||"Unknown":h),m(h,L,ee,pe,u(),C)}function y(h,k){if(typeof h=="object"&&h&&h.$$typeof!==U0){if(bn(h))for(var C=0;C<h.length;C++){var H=h[C];S(H)&&x(H,k)}else if(S(h))h._store&&(h._store.validated=1);else if(h===null||typeof h!="object"?C=null:(C=X&&h[X]||h["@@iterator"],C=typeof C=="function"?C:null),typeof C=="function"&&C!==h.entries&&(C=C.call(h),C!==h))for(;!(h=C.next()).done;)S(h.value)&&x(h.value,k)}}function S(h){return typeof h=="object"&&h!==null&&h.$$typeof===N}function x(h,k){if(h._store&&!h._store.validated&&h.key==null&&(h._store.validated=1,k=_(k),!bu[k])){bu[k]=!0;var C="";h&&h._owner!=null&&h._owner!==u()&&(C=null,typeof h._owner.tag=="number"?C=e(h._owner.type):typeof h._owner.name=="string"&&(C=h._owner.name),C=" It was passed a child from "+C+".");var H=Z.getCurrentStack;Z.getCurrentStack=function(){var pe=l(h.type);return H&&(pe+=H()||""),pe},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',k,C),Z.getCurrentStack=H}}function _(h){var k="",C=u();return C&&(C=e(C.type))&&(k=` Check the render method of \``+C+"`."),k||(h=e(h))&&(k=` Check the top-level render call using <`+h+">."),k}var P=p,N=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),le=Symbol.for("react.suspense"),be=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),he=Symbol.for("react.lazy"),ue=Symbol.for("react.offscreen"),X=Symbol.iterator,me=Symbol.for("react.client.reference"),Z=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=Object.prototype.hasOwnProperty,ie=Object.assign,Re=Symbol.for("react.client.reference"),bn=Array.isArray,Tn=0,du,fu,hu,mu,pu,gu,yu;s.__reactDisabledLog=!0;var rr,vu,or=!1,ar=new(typeof WeakMap=="function"?WeakMap:Map),U0=Symbol.for("react.client.reference"),xu,wu={},Su={},bu={};$t.Fragment=E,$t.jsx=function(h,k,C,H,pe){return g(h,k,C,!1,H,pe)},$t.jsxs=function(h,k,C,H,pe){return g(h,k,C,!0,H,pe)}}()),$t}var cr;function Du(){return cr||(cr=1,process.env.NODE_ENV==="production"?Dn.exports=Tu():Dn.exports=_u()),Dn.exports}var v=Du();const ys=p.createContext({});function vs(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const Mn=p.createContext(null),xs=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Mu extends gs.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const s=n.offsetParent,i=s instanceof HTMLElement&&s.offsetWidth||0,r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft,r.right=i-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Pu({children:e,isPresent:t,anchorX:n}){const s=p.useId(),i=p.useRef(null),r=p.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=p.useContext(xs);return p.useInsertionEffect(()=>{const{width:a,height:l,top:u,left:c,right:d}=r.current;if(t||!i.current||!a||!l)return;const f=n==="left"?`left: ${c}`:`right: ${d}`;i.current.dataset.motionPopId=s;const m=document.createElement("style");return o&&(m.nonce=o),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(` [data-motion-pop-id="${s}"] { position: absolute !important; width: ${a}px !important; height: ${l}px !important; ${f}px !important; top: ${u}px !important; } `),()=>{document.head.removeChild(m)}},[t]),v.jsx(Mu,{isPresent:t,childRef:i,sizeRef:r,children:gs.cloneElement(e,{ref:i})})}const ku=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a})=>{const l=vs(Cu),u=p.useId(),c=p.useCallback(f=>{l.set(f,!0);for(const m of l.values())if(!m)return;s&&s()},[l,s]),d=p.useMemo(()=>({id:u,initial:t,isPresent:n,custom:i,onExitComplete:c,register:f=>(l.set(f,!1),()=>l.delete(f))}),r?[Math.random(),c]:[n,c]);return p.useMemo(()=>{l.forEach((f,m)=>l.set(m,!1))},[n]),gs.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),o==="popLayout"&&(e=v.jsx(Pu,{isPresent:n,anchorX:a,children:e})),v.jsx(Mn.Provider,{value:d,children:e})};function Cu(){return new Map}function dr(e=!0){const t=p.useContext(Mn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=t,r=p.useId();p.useEffect(()=>{e&&i(r)},[e]);const o=p.useCallback(()=>e&&s&&s(r),[r,s,e]);return!n&&s?[!1,o]:[!0]}const Pn=e=>e.key||"";function fr(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const ws=typeof window<"u",hr=ws?p.useLayoutEffect:p.useEffect,Eu=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,u]=dr(o),c=p.useMemo(()=>fr(e),[e]),d=o&&!l?[]:c.map(Pn),f=p.useRef(!0),m=p.useRef(c),g=vs(()=>new Map),[y,S]=p.useState(c),[x,_]=p.useState(c);hr(()=>{f.current=!1,m.current=c;for(let D=0;D<x.length;D++){const E=Pn(x[D]);d.includes(E)?g.delete(E):g.get(E)!==!0&&g.set(E,!1)}},[x,d.length,d.join("-")]);const P=[];if(c!==y){let D=[...c];for(let E=0;E<x.length;E++){const A=x[E],b=Pn(A);d.includes(b)||(D.splice(E,0,A),P.push(A))}r==="wait"&&P.length&&(D=P),_(fr(D)),S(c);return}process.env.NODE_ENV!=="production"&&r==="wait"&&x.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:N}=p.useContext(ys);return v.jsx(v.Fragment,{children:x.map(D=>{const E=Pn(D),A=o&&!l?!1:c===x||d.includes(E),b=()=>{if(g.has(E))g.set(E,!0);else return;let R=!0;g.forEach(Y=>{Y||(R=!1)}),R&&(N==null||N(),_(m.current),o&&(u==null||u()),s&&s())};return v.jsx(ku,{isPresent:A,initial:!f.current||n?void 0:!1,custom:A?void 0:t,presenceAffectsLayout:i,mode:r,onExitComplete:A?void 0:b,anchorX:a,children:D},E)})})},xe=e=>e;let bt=xe,nt=xe;process.env.NODE_ENV!=="production"&&(bt=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},nt=(e,t)=>{if(!e)throw new Error(t)});function Ss(e){let t;return()=>(t===void 0&&(t=e()),t)}const Tt=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s},je=e=>e*1e3,Be=e=>e/1e3,Ou={useManualTiming:!1};function Au(e){let t=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(u){r.has(u)&&(l.schedule(u),e()),u(o)}const l={schedule:(u,c=!1,d=!1)=>{const m=d&&s?t:n;return c&&r.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),r.delete(u)},process:u=>{if(o=u,s){i=!0;return}s=!0,[t,n]=[n,t],t.forEach(a),t.clear(),s=!1,i&&(i=!1,l.process(u))}};return l}const kn=["read","resolveKeyframes","update","preRender","render","postRender"],Vu=40;function mr(e,t){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=kn.reduce((x,_)=>(x[_]=Au(r),x),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:d,postRender:f}=o,m=()=>{const x=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(x-i.timestamp,Vu),1),i.timestamp=x,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),d.process(i),f.process(i),i.isProcessing=!1,n&&t&&(s=!1,e(m))},g=()=>{n=!0,s=!0,i.isProcessing||e(m)};return{schedule:kn.reduce((x,_)=>{const P=o[_];return x[_]=(N,D=!1,E=!1)=>(n||g(),P.schedule(N,D,E)),x},{}),cancel:x=>{for(let _=0;_<kn.length;_++)o[kn[_]].cancel(x)},state:i,steps:o}}const{schedule:G,cancel:st,state:ae,steps:bs}=mr(typeof requestAnimationFrame<"u"?requestAnimationFrame:xe,!0),pr=p.createContext({strict:!1}),gr={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},_t={};for(const e in gr)_t[e]={isEnabled:t=>gr[e].some(n=>!!t[n])};function Nu(e){for(const t in e)_t[t]={..._t[t],...e[t]}}const Ru=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Cn(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ru.has(e)}let yr=e=>!Cn(e);function ju(e){e&&(yr=t=>t.startsWith("on")?!Cn(t):e(t))}try{ju(require("@emotion/is-prop-valid").default)}catch{}function Lu(e,t,n){const s={};for(const i in e)i==="values"&&typeof e.values=="object"||(yr(i)||n===!0&&Cn(i)||!t&&!Cn(i)||e.draggable&&i.startsWith("onDrag"))&&(s[i]=e[i]);return s}const vr=new Set;function En(e,t,n){e||vr.has(t)||(console.warn(t),vr.add(t))}function Yu(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...s)=>(process.env.NODE_ENV!=="production"&&En(!1,"motion() is deprecated. Use motion.create() instead."),e(...s));return new Proxy(n,{get:(s,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const On=p.createContext({});function Gt(e){return typeof e=="string"||Array.isArray(e)}function An(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Ts=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],_s=["initial",...Ts];function Vn(e){return An(e.animate)||_s.some(t=>Gt(e[t]))}function xr(e){return!!(Vn(e)||e.variants)}function Fu(e,t){if(Vn(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Gt(n)?n:void 0,animate:Gt(s)?s:void 0}}return e.inherit!==!1?t:{}}function Iu(e){const{initial:t,animate:n}=Fu(e,p.useContext(On));return p.useMemo(()=>({initial:t,animate:n}),[wr(t),wr(n)])}function wr(e){return Array.isArray(e)?e.join(" "):e}const Wu=Symbol.for("motionComponentSymbol");function Dt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Uu(e,t,n){return p.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):Dt(n)&&(n.current=s))},[t])}const Ds=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Sr="data-"+Ds("framerAppearId"),{schedule:Ms}=mr(queueMicrotask,!1),br=p.createContext({});function Bu(e,t,n,s,i){var r,o;const{visualElement:a}=p.useContext(On),l=p.useContext(pr),u=p.useContext(Mn),c=p.useContext(xs).reducedMotion,d=p.useRef(null);s=s||l.renderer,!d.current&&s&&(d.current=s(e,{visualState:t,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const f=d.current,m=p.useContext(br);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&Hu(d.current,n,i,m);const g=p.useRef(!1);p.useInsertionEffect(()=>{f&&g.current&&f.update(n,u)});const y=n[Sr],S=p.useRef(!!y&&!(!((r=window.MotionHandoffIsComplete)===null||r===void 0)&&r.call(window,y))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,y)));return hr(()=>{f&&(g.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Ms.render(f.render),S.current&&f.animationState&&f.animationState.animateChanges())}),p.useEffect(()=>{f&&(!S.current&&f.animationState&&f.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)===null||x===void 0||x.call(window,y)}),S.current=!1))}),f}function Hu(e,t,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Tr(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&Dt(a),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,layoutScroll:l,layoutRoot:u})}function Tr(e){if(e)return e.options.allowProjection!==!1?e.projection:Tr(e.parent)}function $u({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:s,Component:i}){var r,o;e&&Nu(e);function a(u,c){let d;const f={...p.useContext(xs),...u,layoutId:Gu(u)},{isStatic:m}=f,g=Iu(u),y=s(u,m);if(!m&&ws){zu(f,e);const S=Ku(f);d=S.MeasureLayout,g.visualElement=Bu(i,y,f,t,S.ProjectionNode)}return v.jsxs(On.Provider,{value:g,children:[d&&g.visualElement?v.jsx(d,{visualElement:g.visualElement,...f}):null,n(i,u,Uu(y,g.visualElement,c),y,m,g.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(o=(r=i.displayName)!==null&&r!==void 0?r:i.name)!==null&&o!==void 0?o:""})`}`;const l=p.forwardRef(a);return l[Wu]=i,l}function Gu({layoutId:e}){const t=p.useContext(ys).id;return t&&e!==void 0?t+"-"+e:e}function zu(e,t){const n=p.useContext(pr).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const s="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?bt(!1,s):nt(!1,s)}}function Ku(e){const{drag:t,layout:n}=_t;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const Zu=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ps(e){return typeof e!="string"||e.includes("-")?!1:!!(Zu.indexOf(e)>-1||/[A-Z]/u.test(e))}function _r(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function ks(e,t,n,s){if(typeof t=="function"){const[i,r]=_r(s);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,r]=_r(s);t=t(n!==void 0?n:e.custom,i,r)}return t}const Cs=e=>Array.isArray(e),qu=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),Xu=e=>Cs(e)?e[e.length-1]||0:e,ce=e=>!!(e&&e.getVelocity);function Nn(e){const t=ce(e)?e.get():e;return qu(t)?t.toValue():t}function Ju({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},s,i,r){const o={latestValues:Qu(s,i,r,e),renderState:t()};return n&&(o.onMount=a=>n({props:s,current:a,...o}),o.onUpdate=a=>n(a)),o}const Dr=e=>(t,n)=>{const s=p.useContext(On),i=p.useContext(Mn),r=()=>Ju(e,t,s,i);return n?r():vs(r)};function Qu(e,t,n,s){const i={},r=s(e,{});for(const f in r)i[f]=Nn(r[f]);let{initial:o,animate:a}=e;const l=Vn(e),u=xr(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const d=c?a:o;if(d&&typeof d!="boolean"&&!An(d)){const f=Array.isArray(d)?d:[d];for(let m=0;m<f.length;m++){const g=ks(e,f[m]);if(g){const{transitionEnd:y,transition:S,...x}=g;for(const _ in x){let P=x[_];if(Array.isArray(P)){const N=c?P.length-1:0;P=P[N]}P!==null&&(i[_]=P)}for(const _ in y)i[_]=y[_]}}}return i}const Mt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],dt=new Set(Mt),Mr=e=>t=>typeof t=="string"&&t.startsWith(e),Es=Mr("--"),ec=Mr("var(--"),Os=e=>ec(e)?tc.test(e.split("/*")[0].trim()):!1,tc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Pr=(e,t)=>t&&typeof e=="number"?t.transform(e):e,He=(e,t,n)=>n>t?t:n<e?e:n,Pt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},zt={...Pt,transform:e=>He(0,1,e)},Rn={...Pt,default:1},Kt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),it=Kt("deg"),Le=Kt("%"),V=Kt("px"),nc=Kt("vh"),sc=Kt("vw"),kr={...Le,parse:e=>Le.parse(e)/100,transform:e=>Le.transform(e*100)},ic={borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,radius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,top:V,right:V,bottom:V,left:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,backgroundPositionX:V,backgroundPositionY:V},rc={rotate:it,rotateX:it,rotateY:it,rotateZ:it,scale:Rn,scaleX:Rn,scaleY:Rn,scaleZ:Rn,skew:it,skewX:it,skewY:it,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,transformPerspective:V,opacity:zt,originX:kr,originY:kr,originZ:V},Cr={...Pt,transform:Math.round},As={...ic,...rc,zIndex:Cr,size:V,fillOpacity:zt,strokeOpacity:zt,numOctaves:Cr},oc={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ac=Mt.length;function lc(e,t,n){let s="",i=!0;for(let r=0;r<ac;r++){const o=Mt[r],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=Pr(a,As[o]);if(!l){i=!1;const c=oc[o]||o;s+=`${c}(${u}) `}n&&(t[o]=u)}}return s=s.trim(),n?s=n(t,i?"":s):i&&(s="none"),s}function Vs(e,t,n){const{style:s,vars:i,transformOrigin:r}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(dt.has(l)){o=!0;continue}else if(Es(l)){i[l]=u;continue}else{const c=Pr(u,As[l]);l.startsWith("origin")?(a=!0,r[l]=c):s[l]=c}}if(t.transform||(o||n?s.transform=lc(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;s.transformOrigin=`${l} ${u} ${c}`}}const uc={offset:"stroke-dashoffset",array:"stroke-dasharray"},cc={offset:"strokeDashoffset",array:"strokeDasharray"};function dc(e,t,n=1,s=0,i=!0){e.pathLength=1;const r=i?uc:cc;e[r.offset]=V.transform(-s);const o=V.transform(t),a=V.transform(n);e[r.array]=`${o} ${a}`}function Er(e,t,n){return typeof e=="string"?e:V.transform(t+n*e)}function fc(e,t,n){const s=Er(t,e.x,e.width),i=Er(n,e.y,e.height);return`${s} ${i}`}function Ns(e,{attrX:t,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,d){if(Vs(e,u,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:m,dimensions:g}=e;f.transform&&(g&&(m.transform=f.transform),delete f.transform),g&&(i!==void 0||r!==void 0||m.transform)&&(m.transformOrigin=fc(g,i!==void 0?i:.5,r!==void 0?r:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),s!==void 0&&(f.scale=s),o!==void 0&&dc(f,o,a,l,!1)}const Rs=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Or=()=>({...Rs(),attrs:{}}),js=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ar(e,{style:t,vars:n},s,i){Object.assign(e.style,t,i&&i.getProjectionStyles(s));for(const r in n)e.style.setProperty(r,n[r])}const Vr=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Nr(e,t,n,s){Ar(e,t,void 0,s);for(const i in t.attrs)e.setAttribute(Vr.has(i)?i:Ds(i),t.attrs[i])}const Zt={};function hc(e){for(const t in e)Zt[t]=e[t],Es(t)&&(Zt[t].isCSSVariable=!0)}function Rr(e,{layout:t,layoutId:n}){return dt.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Zt[e]||e==="opacity")}function Ls(e,t,n){var s;const{style:i}=e,r={};for(const o in i)(ce(i[o])||t.style&&ce(t.style[o])||Rr(o,e)||((s=n==null?void 0:n.getValue(o))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(r[o]=i[o]);return r}function jr(e,t,n){const s=Ls(e,t,n);for(const i in e)if(ce(e[i])||ce(t[i])){const r=Mt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=e[i]}return s}function mc(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const Lr=["x","y","width","height","cx","cy","r"],pc={useVisualState:Dr({scrapeMotionValuesFromProps:jr,createRenderState:Or,onUpdate:({props:e,prevProps:t,current:n,renderState:s,latestValues:i})=>{if(!n)return;let r=!!e.drag;if(!r){for(const a in i)if(dt.has(a)){r=!0;break}}if(!r)return;let o=!t;if(t)for(let a=0;a<Lr.length;a++){const l=Lr[a];e[l]!==t[l]&&(o=!0)}o&&G.read(()=>{mc(n,s),G.render(()=>{Ns(s,i,js(n.tagName),e.transformTemplate),Nr(n,s)})})}})},gc={useVisualState:Dr({scrapeMotionValuesFromProps:Ls,createRenderState:Rs})};function Yr(e,t,n){for(const s in t)!ce(t[s])&&!Rr(s,n)&&(e[s]=t[s])}function yc({transformTemplate:e},t){return p.useMemo(()=>{const n=Rs();return Vs(n,t,e),Object.assign({},n.vars,n.style)},[t])}function vc(e,t){const n=e.style||{},s={};return Yr(s,n,e),Object.assign(s,yc(e,t)),s}function xc(e,t){const n={},s=vc(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}function wc(e,t,n,s){const i=p.useMemo(()=>{const r=Or();return Ns(r,t,js(s),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};Yr(r,e.style,e),i.style={...r,...i.style}}return i}function Sc(e=!1){return(n,s,i,{latestValues:r},o)=>{const l=(Ps(n)?wc:xc)(s,r,o,n),u=Lu(s,typeof n=="string",e),c=n!==p.Fragment?{...u,...l,ref:i}:{},{children:d}=s,f=p.useMemo(()=>ce(d)?d.get():d,[d]);return p.createElement(n,{...c,children:f})}}function bc(e,t){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Ps(s)?pc:gc,preloadedFeatures:e,useRender:Sc(i),createVisualElement:t,Component:s};return $u(o)}}function Fr(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}function jn(e,t,n){const s=e.getProps();return ks(s,t,n!==void 0?n:s.custom,e)}const Tc=Ss(()=>window.ScrollTimeline!==void 0);class _c{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let s=0;s<this.animations.length;s++)this.animations[s][t]=n}attachTimeline(t,n){const s=this.animations.map(i=>{if(Tc()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{s.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Dc extends _c{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Ys(e,t){return e?e[t]||e.default||e:void 0}const Fs=2e4;function Ir(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Fs;)t+=n,s=e.next(t);return t>=Fs?1/0:t}function Is(e){return typeof e=="function"}function Wr(e,t){e.timeline=t,e.onfinish=null}const Ws=e=>Array.isArray(e)&&typeof e[0]=="number",Mc={linearEasing:void 0};function Pc(e,t){const n=Ss(e);return()=>{var s;return(s=Mc[t])!==null&&s!==void 0?s:n()}}const Ln=Pc(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ur=(e,t,n=10)=>{let s="";const i=Math.max(Math.round(t/n),2);for(let r=0;r<i;r++)s+=e(Tt(0,i-1,r))+", ";return`linear(${s.substring(0,s.length-2)})`};function Br(e){return!!(typeof e=="function"&&Ln()||!e||typeof e=="string"&&(e in Us||Ln())||Ws(e)||Array.isArray(e)&&e.every(Br))}const qt=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,Us={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qt([0,.65,.55,1]),circOut:qt([.55,0,1,.45]),backIn:qt([.31,.01,.66,-.59]),backOut:qt([.33,1.53,.69,.99])};function Hr(e,t){if(e)return typeof e=="function"&&Ln()?Ur(e,t):Ws(e)?qt(e):Array.isArray(e)?e.map(n=>Hr(n,t)||Us.easeOut):Us[e]}const Ee={x:!1,y:!1};function $r(){return Ee.x||Ee.y}function Gr(e,t,n){var s;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const r=(s=void 0)!==null&&s!==void 0?s:i.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}function zr(e,t){const n=Gr(e),s=new AbortController,i={passive:!0,...t,signal:s.signal};return[n,i,()=>s.abort()]}function Kr(e){return!(e.pointerType==="touch"||$r())}function kc(e,t,n={}){const[s,i,r]=zr(e,n),o=a=>{if(!Kr(a))return;const{target:l}=a,u=t(l,a);if(typeof u!="function"||!l)return;const c=d=>{Kr(d)&&(u(d),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,i)};return s.forEach(a=>{a.addEventListener("pointerenter",o,i)}),r}const Zr=(e,t)=>t?e===t?!0:Zr(e,t.parentElement):!1,Bs=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Cc=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ec(e){return Cc.has(e.tagName)||e.tabIndex!==-1}const Xt=new WeakSet;function qr(e){return t=>{t.key==="Enter"&&e(t)}}function Hs(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Oc=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=qr(()=>{if(Xt.has(n))return;Hs(n,"down");const i=qr(()=>{Hs(n,"up")}),r=()=>Hs(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",r,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function Xr(e){return Bs(e)&&!$r()}function Ac(e,t,n={}){const[s,i,r]=zr(e,n),o=a=>{const l=a.currentTarget;if(!Xr(a)||Xt.has(l))return;Xt.add(l);const u=t(l,a),c=(m,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!Xr(m)||!Xt.has(l))&&(Xt.delete(l),typeof u=="function"&&u(m,{success:g}))},d=m=>{c(m,n.useGlobalTarget||Zr(l,m.target))},f=m=>{c(m,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{!Ec(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",u=>Oc(u,i),i)}),r}function Vc(e){return e==="x"||e==="y"?Ee[e]?null:(Ee[e]=!0,()=>{Ee[e]=!1}):Ee.x||Ee.y?null:(Ee.x=Ee.y=!0,()=>{Ee.x=Ee.y=!1})}const Jr=new Set(["width","height","top","left","right","bottom",...Mt]);let Yn;function Nc(){Yn=void 0}const Ye={now:()=>(Yn===void 0&&Ye.set(ae.isProcessing||Ou.useManualTiming?ae.timestamp:performance.now()),Yn),set:e=>{Yn=e,queueMicrotask(Nc)}};function $s(e,t){e.indexOf(t)===-1&&e.push(t)}function Gs(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class zs{constructor(){this.subscriptions=[]}add(t){return $s(this.subscriptions,t),()=>Gs(this.subscriptions,t)}notify(t,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Qr(e,t){return t?e*(1e3/t):0}const eo=30,Rc=e=>!isNaN(parseFloat(e));class jc{constructor(t,n={}){this.version="12.0.6",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const r=Ye.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ye.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Rc(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&En(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new zs);const s=this.events[t].add(n);return t==="change"?()=>{s(),G.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ye.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>eo)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,eo);return Qr(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Jt(e,t){return new jc(e,t)}function Lc(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Jt(n))}function Yc(e,t){const n=jn(e,t);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Xu(r[o]);Lc(e,o,a)}}function Fc(e){return!!(ce(e)&&e.add)}function Ks(e,t){const n=e.getValue("willChange");if(Fc(n))return n.add(t)}function to(e){return e.props[Sr]}const no=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Ic=1e-7,Wc=12;function Uc(e,t,n,s,i){let r,o,a=0;do o=t+(n-t)/2,r=no(o,s,i)-e,r>0?n=o:t=o;while(Math.abs(r)>Ic&&++a<Wc);return o}function Qt(e,t,n,s){if(e===t&&n===s)return xe;const i=r=>Uc(r,0,1,e,n);return r=>r===0||r===1?r:no(i(r),t,s)}const so=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,io=e=>t=>1-e(1-t),ro=Qt(.33,1.53,.69,.99),Zs=io(ro),oo=so(Zs),ao=e=>(e*=2)<1?.5*Zs(e):.5*(2-Math.pow(2,-10*(e-1))),qs=e=>1-Math.sin(Math.acos(e)),lo=io(qs),uo=so(qs),co=e=>/^0[^.\s]+$/u.test(e);function Bc(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||co(e):!0}const en=e=>Math.round(e*1e5)/1e5,Xs=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Hc(e){return e==null}const $c=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Js=(e,t)=>n=>!!(typeof n=="string"&&$c.test(n)&&n.startsWith(e)||t&&!Hc(n)&&Object.prototype.hasOwnProperty.call(n,t)),fo=(e,t,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(Xs);return{[e]:parseFloat(i),[t]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Gc=e=>He(0,255,e),Qs={...Pt,transform:e=>Math.round(Gc(e))},ft={test:Js("rgb","red"),parse:fo("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Qs.transform(e)+", "+Qs.transform(t)+", "+Qs.transform(n)+", "+en(zt.transform(s))+")"};function zc(e){let t="",n="",s="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const ei={test:Js("#"),parse:zc,transform:ft.transform},kt={test:Js("hsl","hue"),parse:fo("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+Le.transform(en(t))+", "+Le.transform(en(n))+", "+en(zt.transform(s))+")"},de={test:e=>ft.test(e)||ei.test(e)||kt.test(e),parse:e=>ft.test(e)?ft.parse(e):kt.test(e)?kt.parse(e):ei.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ft.transform(e):kt.transform(e)},Kc=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Zc(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Xs))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Kc))===null||n===void 0?void 0:n.length)||0)>0}const ho="number",mo="color",qc="var",Xc="var(",po="${}",Jc=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function tn(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=t.replace(Jc,l=>(de.test(l)?(s.color.push(r),i.push(mo),n.push(de.parse(l))):l.startsWith(Xc)?(s.var.push(r),i.push(qc),n.push(l)):(s.number.push(r),i.push(ho),n.push(parseFloat(l))),++r,po)).split(po);return{values:n,split:a,indexes:s,types:i}}function go(e){return tn(e).values}function yo(e){const{split:t,types:n}=tn(e),s=t.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=t[o],i[o]!==void 0){const a=n[o];a===ho?r+=en(i[o]):a===mo?r+=de.transform(i[o]):r+=i[o]}return r}}const Qc=e=>typeof e=="number"?0:e;function ed(e){const t=go(e);return yo(e)(t.map(Qc))}const rt={test:Zc,parse:go,createTransformer:yo,getAnimatableNone:ed},td=new Set(["brightness","contrast","saturate","opacity"]);function nd(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(Xs)||[];if(!s)return e;const i=n.replace(s,"");let r=td.has(t)?1:0;return s!==n&&(r*=100),t+"("+r+i+")"}const sd=/\b([a-z-]*)\(.*?\)/gu,ti={...rt,getAnimatableNone:e=>{const t=e.match(sd);return t?t.map(nd).join(" "):e}},id={...As,color:de,backgroundColor:de,outlineColor:de,fill:de,stroke:de,borderColor:de,borderTopColor:de,borderRightColor:de,borderBottomColor:de,borderLeftColor:de,filter:ti,WebkitFilter:ti},ni=e=>id[e];function vo(e,t){let n=ni(e);return n!==ti&&(n=rt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const rd=new Set(["auto","none","0"]);function od(e,t,n){let s=0,i;for(;s<e.length&&!i;){const r=e[s];typeof r=="string"&&!rd.has(r)&&tn(r).values.length&&(i=e[s]),s++}if(i&&n)for(const r of t)e[r]=vo(n,i)}const xo=e=>e===Pt||e===V,wo=(e,t)=>parseFloat(e.split(", ")[t]),So=(e,t)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return wo(i[1],t);{const r=s.match(/^matrix\((.+)\)$/u);return r?wo(r[1],e):0}},ad=new Set(["x","y","z"]),ld=Mt.filter(e=>!ad.has(e));function ud(e){const t=[];return ld.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const Ct={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:So(4,13),y:So(5,14)};Ct.translateX=Ct.x,Ct.translateY=Ct.y;const ht=new Set;let si=!1,ii=!1;function bo(){if(ii){const e=Array.from(ht).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const i=ud(s);i.length&&(n.set(s,i),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))===null||a===void 0||a.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}ii=!1,si=!1,ht.forEach(e=>e.complete()),ht.clear()}function To(){ht.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ii=!0)})}function cd(){To(),bo()}class ri{constructor(t,n,s,i,r,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ht.add(this),si||(si=!0,G.read(To),G.resolveKeyframes(bo))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:i}=this;for(let r=0;r<t.length;r++)if(t[r]===null)if(r===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&n){const l=s.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[r]=t[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ht.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ht.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const _o=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),dd=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fd(e){const t=dd.exec(e);if(!t)return[,];const[,n,s,i]=t;return[`--${n??s}`,i]}const hd=4;function Do(e,t,n=1){nt(n<=hd,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[s,i]=fd(e);if(!s)return;const r=window.getComputedStyle(t).getPropertyValue(s);if(r){const o=r.trim();return _o(o)?parseFloat(o):o}return Os(i)?Do(i,t,n+1):i}const Mo=e=>t=>t.test(e),Po=[Pt,V,Le,it,sc,nc,{test:e=>e==="auto",parse:e=>e}],ko=e=>Po.find(Mo(e));class Co extends ri{constructor(t,n,s,i,r){super(t,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),Os(u))){const c=Do(u,n.current);c!==void 0&&(t[l]=c),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Jr.has(s)||t.length!==2)return;const[i,r]=t,o=ko(i),a=ko(r);if(o!==a)if(xo(o)&&xo(a))for(let l=0;l<t.length;l++){const u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let i=0;i<t.length;i++)Bc(t[i])&&s.push(i);s.length&&od(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ct[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(s,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const r=n.getValue(s);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=Ct[s](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Eo=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(rt.test(e)||e==="0")&&!e.startsWith("url("));function md(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function pd(e,t,n,s){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const r=e[e.length-1],o=Eo(i,t),a=Eo(r,t);return bt(o===a,`You are trying to animate ${t} from "${i}" to "${r}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${r} via the \`style\` property.`),!o||!a?!1:md(e)||(n==="spring"||Is(n))&&s}const gd=e=>e!==null;function Fn(e,{repeat:t,repeatType:n="loop"},s){const i=e.filter(gd),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return!r||s===void 0?i[r]:s}const yd=40;class Oo{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ye.now(),this.options={autoplay:t,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>yd?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&cd(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ye.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:r,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!pd(t,s,i,r))if(o)this.options.duration=0;else{l&&l(Fn(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const c=this.initPlayback(t,n);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...c},this.onPostResolved())}