UNPKG

@athosws/react-components

Version:

This is a set of useful ReactJS components developed by Athos.\n Email:ladiesman217.as@gmail.com

10 lines 764 kB
import*as e from"react";import t,{createContext as n,useRef as r,useLayoutEffect as o,useEffect as a,useId as i,useContext as l,useInsertionEffect as s,useCallback as u,useMemo as c,Children as d,isValidElement as f,useState as p,forwardRef as h,Fragment as m,createElement as g,Component as y,memo as v}from"react";import b from"styled-components";import w from"chroma-js";import{defaultDropAnimationSideEffects as k,DragOverlay as C,MeasuringStrategy as x,useSensors as S,useSensor as T,PointerSensor as P,KeyboardSensor as E,DndContext as R}from"@dnd-kit/core";import{useSortable as A,defaultAnimateLayoutChanges as D,sortableKeyboardCoordinates as z,SortableContext as L}from"@dnd-kit/sortable";import{v4 as O}from"uuid";import{useDispatch as N,useSelector as M,Provider as j}from"react-redux";import{createSlice as I,configureStore as _}from"@reduxjs/toolkit";import{Draggable as F,DragDropContext as V,Droppable as B}from"react-beautiful-dnd";import $,{createPortal as U}from"react-dom";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('@tailwind base;\r\n@tailwind components;\r\n@tailwind utilities;\r\n\r\nbody {\r\n margin: 0;\r\n -webkit-font-smoothing: antialiased;\r\n -moz-osx-font-smoothing: grayscale;\r\n background-color: white;\r\n font-family: "Anek Latin";\r\n}\r\n\r\ninput[type="password"]::-ms-reveal,\r\ninput[type="password"]::-ms-clear {\r\n display: none;\r\n}\r\n');var H,W={exports:{}},q={};var Y,Q={}; /** * @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. */"production"===process.env.NODE_ENV?W.exports=function(){if(H)return q;H=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(t,n,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==n.key&&(o=""+n.key),"key"in n)for(var a in r={},n)"key"!==a&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:e,type:t,key:o,ref:void 0!==n?n:null,props:r}}return q.Fragment=t,q.jsx=n,q.jsxs=n,q}():W.exports=(Y||(Y=1,"production"!==process.env.NODE_ENV&&function(){function e(t){if(null==t)return null;if("function"==typeof t)return t.$$typeof===j?null:t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case S:return"Fragment";case x:return"Portal";case P:return"Profiler";case T:return"StrictMode";case D:return"Suspense";case z:return"SuspenseList"}if("object"==typeof t)switch("number"==typeof t.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case R:return(t.displayName||"Context")+".Provider";case E:return(t._context.displayName||"Context")+".Consumer";case A:var n=t.render;return(t=t.displayName)||(t=""!==(t=n.displayName||n.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case L:return null!==(n=t.displayName||null)?n:e(t.type)||"Memo";case O:n=t._payload,t=t._init;try{return e(t(n))}catch(e){}}return null}function n(e){return""+e}function r(e){try{n(e);var t=!1}catch(e){t=!0}if(t){var r=(t=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),n(e)}}function o(){}function a(e){if(void 0===U)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);U=t&&t[1]||"",H=-1<e.stack.indexOf("\n at")?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+U+e+H}function i(e,t){if(!e||q)return"";var n,r=Y.get(e);if(void 0!==r)return r;q=!0,r=Error.prepareStackTrace,Error.prepareStackTrace=void 0,n=I.H,I.H=null,function(){if(0===$){h=console.log,m=console.info,g=console.warn,y=console.error,v=console.group,b=console.groupCollapsed,w=console.groupEnd;var e={configurable:!0,enumerable:!0,value:o,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}$++}();try{var i={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&"function"==typeof n.catch&&n.catch((function(){}))}}catch(e){if(e&&r&&"string"==typeof e.stack)return[e.stack,r.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=i.DetermineComponentFrameRoot(),u=s[0],c=s[1];if(u&&c){var d=u.split("\n"),f=c.split("\n");for(s=l=0;l<d.length&&!d[l].includes("DetermineComponentFrameRoot");)l++;for(;s<f.length&&!f[s].includes("DetermineComponentFrameRoot");)s++;if(l===d.length||s===f.length)for(l=d.length-1,s=f.length-1;1<=l&&0<=s&&d[l]!==f[s];)s--;for(;1<=l&&0<=s;l--,s--)if(d[l]!==f[s]){if(1!==l||1!==s)do{if(l--,0>--s||d[l]!==f[s]){var p="\n"+d[l].replace(" at new "," at ");return e.displayName&&p.includes("<anonymous>")&&(p=p.replace("<anonymous>",e.displayName)),"function"==typeof e&&Y.set(e,p),p}}while(1<=l&&0<=s);break}}}finally{q=!1,I.H=n,function(){if(0==--$){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},e,{value:h}),info:F({},e,{value:m}),warn:F({},e,{value:g}),error:F({},e,{value:y}),group:F({},e,{value:v}),groupCollapsed:F({},e,{value:b}),groupEnd:F({},e,{value:w})})}0>$&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=r}return d=(d=e?e.displayName||e.name:"")?a(d):"","function"==typeof e&&Y.set(e,d),d}function l(e){if(null==e)return"";if("function"==typeof e){var t=e.prototype;return i(e,!(!t||!t.isReactComponent))}if("string"==typeof e)return a(e);switch(e){case D:return a("Suspense");case z:return a("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case A:return i(e.render,!1);case L:return l(e.type);case O:t=e._payload,e=e._init;try{return l(e(t))}catch(e){}}return""}function s(){var e=I.A;return null===e?null:e.getOwner()}function u(){var t=e(this.type);return X[t]||(X[t]=!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.")),void 0!==(t=this.props.ref)?t:null}function c(t,n,o,a,i,l){if("string"==typeof t||"function"==typeof t||t===S||t===P||t===T||t===D||t===z||t===N||"object"==typeof t&&null!==t&&(t.$$typeof===O||t.$$typeof===L||t.$$typeof===R||t.$$typeof===E||t.$$typeof===A||t.$$typeof===V||void 0!==t.getModuleId)){var c=n.children;if(void 0!==c)if(a)if(B(c)){for(a=0;a<c.length;a++)d(c[a],t);Object.freeze&&Object.freeze(c)}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 d(c,t)}else c="",(void 0===t||"object"==typeof t&&null!==t&&0===Object.keys(t).length)&&(c+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),null===t?a="null":B(t)?a="array":void 0!==t&&t.$$typeof===C?(a="<"+(e(t.type)||"Unknown")+" />",c=" Did you accidentally export a JSX literal instead of a component?"):a=typeof t,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",a,c);if(_.call(n,"key")){c=e(t);var f=Object.keys(n).filter((function(e){return"key"!==e}));a=0<f.length?"{key: someKey, "+f.join(": ..., ")+": ...}":"{key: someKey}",K[c+a]||(f=0<f.length?"{"+f.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',a,c,f,c),K[c+a]=!0)}if(c=null,void 0!==o&&(r(o),c=""+o),function(e){if(_.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(n)&&(r(n.key),c=""+n.key),"key"in n)for(var p in o={},n)"key"!==p&&(o[p]=n[p]);else o=n;return c&&function(e,t){function n(){W||(W=!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)",t))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(o,"function"==typeof t?t.displayName||t.name||"Unknown":t),function(e,t,n,r,o,a){return n=a.ref,e={$$typeof:C,type:e,key:t,props:a,_owner:o},null!==(void 0!==n?n:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:u}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(t,c,l,0,s(),o)}function d(e,t){if("object"==typeof e&&e&&e.$$typeof!==Z)if(B(e))for(var n=0;n<e.length;n++){var r=e[n];f(r)&&p(r,t)}else if(f(e))e._store&&(e._store.validated=1);else if("function"==typeof(n=null===e||"object"!=typeof e?null:"function"==typeof(n=M&&e[M]||e["@@iterator"])?n:null)&&n!==e.entries&&(n=n.call(e))!==e)for(;!(e=n.next()).done;)f(e.value)&&p(e.value,t)}function f(e){return"object"==typeof e&&null!==e&&e.$$typeof===C}function p(t,n){if(t._store&&!t._store.validated&&null==t.key&&(t._store.validated=1,n=function(t){var n="",r=s();return r&&(r=e(r.type))&&(n="\n\nCheck the render method of `"+r+"`."),n||(t=e(t))&&(n="\n\nCheck the top-level render call using <"+t+">."),n}(n),!G[n])){G[n]=!0;var r="";t&&null!=t._owner&&t._owner!==s()&&(r=null,"number"==typeof t._owner.tag?r=e(t._owner.type):"string"==typeof t._owner.name&&(r=t._owner.name),r=" It was passed a child from "+r+".");var o=I.getCurrentStack;I.getCurrentStack=function(){var e=l(t.type);return o&&(e+=o()||""),e},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.',n,r),I.getCurrentStack=o}}var h,m,g,y,v,b,w,k=t,C=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),N=Symbol.for("react.offscreen"),M=Symbol.iterator,j=Symbol.for("react.client.reference"),I=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_=Object.prototype.hasOwnProperty,F=Object.assign,V=Symbol.for("react.client.reference"),B=Array.isArray,$=0;o.__reactDisabledLog=!0;var U,H,W,q=!1,Y=new("function"==typeof WeakMap?WeakMap:Map),Z=Symbol.for("react.client.reference"),X={},K={},G={};Q.Fragment=S,Q.jsx=function(e,t,n,r,o){return c(e,t,n,!1,0,o)},Q.jsxs=function(e,t,n,r,o){return c(e,t,n,!0,0,o)}}()),Q);var Z=W.exports;const X=n({});function K(e){const t=r(null);return null===t.current&&(t.current=e()),t.current}const G="undefined"!=typeof window,J=G?o:a,ee=n(null),te=n({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class ne extends e.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=t.offsetParent,n=e instanceof HTMLElement&&e.offsetWidth||0,r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft,r.right=n-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}function re({children:t,isPresent:n,anchorX:o}){const a=i(),u=r(null),c=r({width:0,height:0,top:0,left:0,right:0}),{nonce:d}=l(te);return s((()=>{const{width:e,height:t,top:r,left:i,right:l}=c.current;if(n||!u.current||!e||!t)return;const s="left"===o?`left: ${i}`:`right: ${l}`;u.current.dataset.motionPopId=a;const f=document.createElement("style");return d&&(f.nonce=d),document.head.appendChild(f),f.sheet&&f.sheet.insertRule(`\n [data-motion-pop-id="${a}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${t}px !important;\n ${s}px !important;\n top: ${r}px !important;\n }\n `),()=>{document.head.removeChild(f)}}),[n]),Z.jsx(ne,{isPresent:n,childRef:u,sizeRef:c,children:e.cloneElement(t,{ref:u})})}const oe=({children:t,initial:n,isPresent:r,onExitComplete:o,custom:a,presenceAffectsLayout:l,mode:s,anchorX:d})=>{const f=K(ae),p=i(),h=u((e=>{f.set(e,!0);for(const e of f.values())if(!e)return;o&&o()}),[f,o]),m=c((()=>({id:p,initial:n,isPresent:r,custom:a,onExitComplete:h,register:e=>(f.set(e,!1),()=>f.delete(e))})),l?[Math.random(),h]:[r,h]);return c((()=>{f.forEach(((e,t)=>f.set(t,!1)))}),[r]),e.useEffect((()=>{!r&&!f.size&&o&&o()}),[r]),"popLayout"===s&&(t=Z.jsx(re,{isPresent:r,anchorX:d,children:t})),Z.jsx(ee.Provider,{value:m,children:t})};function ae(){return new Map}function ie(e=!0){const t=l(ee);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=i();a((()=>{if(e)return o(s)}),[e]);const c=u((()=>e&&r&&r(s)),[s,r,e]);return!n&&r?[!1,c]:[!0]}const le=e=>e.key||"";function se(e){const t=[];return d.forEach(e,(e=>{f(e)&&t.push(e)})),t}const ue=({children:e,custom:t,initial:n=!0,onExitComplete:o,presenceAffectsLayout:a=!0,mode:i="sync",propagate:s=!1,anchorX:u="left"})=>{const[d,f]=ie(s),h=c((()=>se(e)),[e]),m=s&&!d?[]:h.map(le),g=r(!0),y=r(h),v=K((()=>new Map)),[b,w]=p(h),[k,C]=p(h);J((()=>{g.current=!1,y.current=h;for(let e=0;e<k.length;e++){const t=le(k[e]);m.includes(t)?v.delete(t):!0!==v.get(t)&&v.set(t,!1)}}),[k,m.length,m.join("-")]);const x=[];if(h!==b){let e=[...h];for(let t=0;t<k.length;t++){const n=k[t],r=le(n);m.includes(r)||(e.splice(t,0,n),x.push(n))}return"wait"===i&&x.length&&(e=x),C(se(e)),w(h),null}"production"!==process.env.NODE_ENV&&"wait"===i&&k.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:S}=l(X);return Z.jsx(Z.Fragment,{children:k.map((e=>{const r=le(e),l=!(s&&!d)&&(h===k||m.includes(r));return Z.jsx(oe,{isPresent:l,initial:!(g.current&&!n)&&void 0,custom:t,presenceAffectsLayout:a,mode:i,onExitComplete:l?void 0:()=>{if(!v.has(r))return;v.set(r,!0);let e=!0;v.forEach((t=>{t||(e=!1)})),e&&(null==S||S(),C(y.current),s&&(null==f||f()),o&&o())},anchorX:u,children:e},r)}))})};function ce(e,t){-1===e.indexOf(t)&&e.push(t)}function de(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const fe=e=>e;let pe=fe,he=fe;"production"!==process.env.NODE_ENV&&(pe=(e,t)=>{e||"undefined"==typeof console||console.warn(t)},he=(e,t)=>{if(!e)throw new Error(t)});const me=!1,ge=!1;function ye(e){let t;return()=>(void 0===t&&(t=e()),t)}const ve=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r};class be{constructor(){this.subscriptions=[]}add(e){return ce(this.subscriptions,e),()=>de(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const we=e=>1e3*e,ke=e=>e/1e3;function Ce(e,t){return t?e*(1e3/t):0}const xe=new Set;function Se(e,t,n){e||xe.has(t)||(console.warn(t),n&&console.warn(n),xe.add(t))}const Te=ye((()=>void 0!==window.ScrollTimeline));class Pe{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map((e=>"finished"in e?e.finished:e)))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e,t){const n=this.animations.map((n=>Te()&&n.attachTimeline?n.attachTimeline(e):"function"==typeof t?t(n):void 0));return()=>{n.forEach(((e,t)=>{e&&e(),this.animations[t].stop()}))}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach((t=>t[e]()))}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Ee extends Pe{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function Re(e,t){return e?e[t]||e.default||e:void 0}const Ae=2e4;function De(e){let t=0;let n=e.next(t);for(;!n.done&&t<Ae;)t+=50,n=e.next(t);return t>=Ae?1/0:t}function ze(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(De(r),Ae);return{type:"keyframes",ease:e=>r.next(o*e).value/t,duration:ke(o)}}function Le(e){return"function"==typeof e}function Oe(e,t){e.timeline=t,e.onfinish=null}const Ne=e=>Array.isArray(e)&&"number"==typeof e[0],Me={linearEasing:void 0};function je(e,t){const n=ye(e);return()=>{var e;return null!==(e=Me[t])&&void 0!==e?e:n()}}const Ie=je((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0}),"linearEasing"),_e=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let t=0;t<o;t++)r+=e(ve(0,o-1,t))+", ";return`linear(${r.substring(0,r.length-2)})`};function Fe(e){return Boolean("function"==typeof e&&Ie()||!e||"string"==typeof e&&(e in Be||Ie())||Ne(e)||Array.isArray(e)&&e.every(Fe))}const Ve=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Be={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ve([0,.65,.55,1]),circOut:Ve([.55,0,1,.45]),backIn:Ve([.31,.01,.66,-.59]),backOut:Ve([.33,1.53,.69,.99])};function $e(e,t){return e?"function"==typeof e&&Ie()?_e(e,t):Ne(e)?Ve(e):Array.isArray(e)?e.map((e=>$e(e,t)||Be.easeOut)):Be[e]:void 0}const Ue=["read","resolveKeyframes","update","preRender","render","postRender"],He={value:null,addProjectionMetrics:null};function We(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,i=Ue.reduce(((e,n)=>(e[n]=function(e,t){let n=new Set,r=new Set,o=!1,a=!1;const i=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},s=0;function u(t){i.has(t)&&(c.schedule(t),e()),s++,t(l)}const c={schedule:(e,t=!1,a=!1)=>{const l=a&&o?n:r;return t&&i.add(e),l.has(e)||l.add(e),e},cancel:e=>{r.delete(e),i.delete(e)},process:e=>{l=e,o?a=!0:(o=!0,[n,r]=[r,n],n.forEach(u),t&&He.value&&He.value.frameloop[t].push(s),s=0,n.clear(),o=!1,a&&(a=!1,c.process(e)))}};return c}(a,t?n:void 0),e)),{}),{read:l,resolveKeyframes:s,update:u,preRender:c,render:d,postRender:f}=i,p=()=>{const a=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(a-o.timestamp,40),1),o.timestamp=a,o.isProcessing=!0,l.process(o),s.process(o),u.process(o),c.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(p))};return{schedule:Ue.reduce(((t,a)=>{const l=i[a];return t[a]=(t,a=!1,i=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(p)),l.schedule(t,a,i)),t}),{}),cancel:e=>{for(let t=0;t<Ue.length;t++)i[Ue[t]].cancel(e)},state:o,steps:i}}const{schedule:qe,cancel:Ye,state:Qe,steps:Ze}=We("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:fe,!0),{schedule:Xe,cancel:Ke}=We(queueMicrotask,!1);let Ge;function Je(){Ge=void 0}const et={now:()=>(void 0===Ge&&et.set(Qe.isProcessing||ge?Qe.timestamp:performance.now()),Ge),set:e=>{Ge=e,queueMicrotask(Je)}},tt={x:!1,y:!1};function nt(){return tt.x||tt.y}function rt(e,t,n){var r;if(e instanceof EventTarget)return[e];if("string"==typeof e){let o=document;t&&(o=t.current);const a=null!==(r=null==n?void 0:n[e])&&void 0!==r?r:o.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}function ot(e,t){const n=rt(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function at(e){return!("touch"===e.pointerType||nt())}function it(e,t){const n=`${t}PointerCapture`;if(e.target instanceof Element&&n in e.target&&void 0!==e.pointerId)try{e.target[n](e.pointerId)}catch(e){}}const lt=(e,t)=>!!t&&(e===t||lt(e,t.parentElement)),st=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,ut=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const ct=new WeakSet;function dt(e){return t=>{"Enter"===t.key&&e(t)}}function ft(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function pt(e){return st(e)&&!nt()}function ht(e,t,n={}){const[r,o,a]=ot(e,n),i=e=>{const n=e.currentTarget;if(!n||!pt(e)||ct.has(n))return;ct.add(n),it(e,"set");const r=t(n,e),a=(e,t)=>{n.removeEventListener("pointerup",i),n.removeEventListener("pointercancel",l),it(e,"release"),pt(e)&&ct.has(n)&&(ct.delete(n),"function"==typeof r&&r(e,{success:t}))},i=e=>{const t=!!e.isTrusted&&(r=e,o=n instanceof Element?n.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight},r.clientX<o.left||r.clientX>o.right||r.clientY<o.top||r.clientY>o.bottom);var r,o;a(e,!t&&(!(n instanceof Element)||lt(n,e.target)))},l=e=>{a(e,!1)};n.addEventListener("pointerup",i,o),n.addEventListener("pointercancel",l,o),n.addEventListener("lostpointercapture",l,o)};return r.forEach((e=>{let t=!1;var r;(e=n.useGlobalTarget?window:e)instanceof HTMLElement&&(t=!0,r=e,ut.has(r.tagName)||-1!==r.tabIndex||null!==e.getAttribute("tabindex")||(e.tabIndex=0)),e.addEventListener("pointerdown",i,o),t&&e.addEventListener("focus",(e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=dt((()=>{if(ct.has(n))return;ft(n,"down");const e=dt((()=>{ft(n,"up")}));n.addEventListener("keyup",e,t),n.addEventListener("blur",(()=>ft(n,"cancel")),t)}));n.addEventListener("keydown",r,t),n.addEventListener("blur",(()=>n.removeEventListener("keydown",r)),t)})(e,o)),o)})),a}class mt{constructor(e,t={}){this.version="12.5.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=et.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=et.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return"production"!==process.env.NODE_ENV&&Se(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new be);const n=this.events[e].add(t);return"change"===e?()=>{n(),qe.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=et.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Ce(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),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 gt(e,t){return new mt(e,t)}const yt=n({strict:!1}),vt={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"]},bt={};for(const e in vt)bt[e]={isEnabled:t=>vt[e].some((e=>!!t[e]))};const wt=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 kt(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||wt.has(e)}let Ct=e=>!kt(e);try{(xt=require("@emotion/is-prop-valid").default)&&(Ct=e=>e.startsWith("on")?!kt(e):xt(e))}catch(e){}var xt;function St(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy(((...t)=>("production"!==process.env.NODE_ENV&&Se(!1,"motion() is deprecated. Use motion.create() instead."),e(...t))),{get:(n,r)=>"create"===r?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}const Tt=n({});function Pt(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function Et(e){return"string"==typeof e||Array.isArray(e)}const Rt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],At=["initial",...Rt];function Dt(e){return Pt(e.animate)||At.some((t=>Et(e[t])))}function zt(e){return Boolean(Dt(e)||e.variants)}function Lt(e){const{initial:t,animate:n}=function(e,t){if(Dt(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Et(t)?t:void 0,animate:Et(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,l(Tt));return c((()=>({initial:t,animate:n})),[Ot(t),Ot(n)])}function Ot(e){return Array.isArray(e)?e.join(" "):e}const Nt=Symbol.for("motionComponentSymbol");function Mt(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function jt(e,t,n){return u((r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):Mt(n)&&(n.current=r))}),[t])}const It=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),_t="data-"+It("framerAppearId"),Ft=n({});function Vt(e,t,n,o,i){var u,c;const{visualElement:d}=l(Tt),f=l(yt),p=l(ee),h=l(te).reducedMotion,m=r(null);o=o||f.renderer,!m.current&&o&&(m.current=o(e,{visualState:t,parent:d,props:n,presenceContext:p,blockInitialAnimation:!!p&&!1===p.initial,reducedMotionConfig:h}));const g=m.current,y=l(Ft);!g||g.projection||!i||"html"!==g.type&&"svg"!==g.type||function(e,t,n,r){const{layoutId:o,layout:a,drag:i,dragConstraints:l,layoutScroll:s,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Bt(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:Boolean(i)||l&&Mt(l),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:r,layoutScroll:s,layoutRoot:u})}(m.current,n,i,y);const v=r(!1);s((()=>{g&&v.current&&g.update(n,p)}));const b=n[_t],w=r(Boolean(b)&&!(null===(u=window.MotionHandoffIsComplete)||void 0===u?void 0:u.call(window,b))&&(null===(c=window.MotionHasOptimisedAnimation)||void 0===c?void 0:c.call(window,b)));return J((()=>{g&&(v.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),Xe.render(g.render),w.current&&g.animationState&&g.animationState.animateChanges())})),a((()=>{g&&(!w.current&&g.animationState&&g.animationState.animateChanges(),w.current&&(queueMicrotask((()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,b)})),w.current=!1))})),g}function Bt(e){if(e)return!1!==e.options.allowProjection?e.projection:Bt(e.parent)}function $t({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){var a,i;function s(a,i){let s;const u={...l(te),...a,layoutId:Ut(a)},{isStatic:c}=u,d=Lt(a),f=r(a,c);if(!c&&G){!function(e,t){const n=l(yt).strict;if("production"!==process.env.NODE_ENV&&t&&n){const t="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?pe(!1,t):he(!1,t)}}(u,e);const n=function(e){const{drag:t,layout:n}=bt;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(u);s=n.MeasureLayout,d.visualElement=Vt(o,f,u,t,n.ProjectionNode)}return Z.jsxs(Tt.Provider,{value:d,children:[s&&d.visualElement?Z.jsx(s,{visualElement:d.visualElement,...u}):null,n(o,a,jt(f,d.visualElement,i),f,c,d.visualElement)]})}e&&function(e){for(const t in e)bt[t]={...bt[t],...e[t]}}(e),s.displayName=`motion.${"string"==typeof o?o:`create(${null!==(i=null!==(a=o.displayName)&&void 0!==a?a:o.name)&&void 0!==i?i:""})`}`;const u=h(s);return u[Nt]=o,u}function Ut({layoutId:e}){const t=l(X).id;return t&&void 0!==e?t+"-"+e:e}const Ht=e=>t=>"string"==typeof t&&t.startsWith(e),Wt=Ht("--"),qt=Ht("var(--"),Yt=e=>!!qt(e)&&Qt.test(e.split("/*")[0].trim()),Qt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Zt={};const Xt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Kt=new Set(Xt);function Gt(e,{layout:t,layoutId:n}){return Kt.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Zt[e]||"opacity"===e)}const Jt=e=>Boolean(e&&e.getVelocity),en=(e,t)=>t&&"number"==typeof e?t.transform(e):e,tn=(e,t,n)=>n>t?t:n<e?e:n,nn={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},rn={...nn,transform:e=>tn(0,1,e)},on={...nn,default:1},an=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),ln=an("deg"),sn=an("%"),un=an("px"),cn=an("vh"),dn=an("vw"),fn={...sn,parse:e=>sn.parse(e)/100,transform:e=>sn.transform(100*e)},pn={borderWidth:un,borderTopWidth:un,borderRightWidth:un,borderBottomWidth:un,borderLeftWidth:un,borderRadius:un,radius:un,borderTopLeftRadius:un,borderTopRightRadius:un,borderBottomRightRadius:un,borderBottomLeftRadius:un,width:un,maxWidth:un,height:un,maxHeight:un,top:un,right:un,bottom:un,left:un,padding:un,paddingTop:un,paddingRight:un,paddingBottom:un,paddingLeft:un,margin:un,marginTop:un,marginRight:un,marginBottom:un,marginLeft:un,backgroundPositionX:un,backgroundPositionY:un},hn={rotate:ln,rotateX:ln,rotateY:ln,rotateZ:ln,scale:on,scaleX:on,scaleY:on,scaleZ:on,skew:ln,skewX:ln,skewY:ln,distance:un,translateX:un,translateY:un,translateZ:un,x:un,y:un,z:un,perspective:un,transformPerspective:un,opacity:rn,originX:fn,originY:fn,originZ:un},mn={...nn,transform:Math.round},gn={...pn,...hn,zIndex:mn,size:un,fillOpacity:rn,strokeOpacity:rn,numOctaves:mn},yn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},vn=Xt.length;function bn(e,t,n){const{style:r,vars:o,transformOrigin:a}=e;let i=!1,l=!1;for(const e in t){const n=t[e];if(Kt.has(e))i=!0;else if(Wt(e))o[e]=n;else{const t=en(n,gn[e]);e.startsWith("origin")?(l=!0,a[e]=t):r[e]=t}}if(t.transform||(i||n?r.transform=function(e,t,n){let r="",o=!0;for(let a=0;a<vn;a++){const i=Xt[a],l=e[i];if(void 0===l)continue;let s=!0;if(s="number"==typeof l?l===(i.startsWith("scale")?1:0):0===parseFloat(l),!s||n){const e=en(l,gn[i]);s||(o=!1,r+=`${yn[i]||i}(${e}) `),n&&(t[i]=e)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:e="50%",originY:t="50%",originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}const wn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function kn(e,t,n){for(const r in t)Jt(t[r])||Gt(r,n)||(e[r]=t[r])}function Cn(e,t){const n={};return kn(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return c((()=>{const n=wn();return bn(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),n}function xn(e,t){const n={},r=Cn(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Sn=["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 Tn(e){return"string"==typeof e&&!e.includes("-")&&!!(Sn.indexOf(e)>-1||/[A-Z]/u.test(e))}const Pn={offset:"stroke-dashoffset",array:"stroke-dasharray"},En={offset:"strokeDashoffset",array:"strokeDasharray"};function Rn(e,t,n){return"string"==typeof e?e:un.transform(t+n*e)}function An(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:a,pathLength:i,pathSpacing:l=1,pathOffset:s=0,...u},c,d){if(bn(e,u,d),c)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:h}=e;f.transform&&(h&&(p.transform=f.transform),delete f.transform),h&&(void 0!==o||void 0!==a||p.transform)&&(p.transformOrigin=function(e,t,n){return`${Rn(t,e.x,e.width)} ${Rn(n,e.y,e.height)}`}(h,void 0!==o?o:.5,void 0!==a?a:.5)),void 0!==t&&(f.x=t),void 0!==n&&(f.y=n),void 0!==r&&(f.scale=r),void 0!==i&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const a=o?Pn:En;e[a.offset]=un.transform(-r);const i=un.transform(t),l=un.transform(n);e[a.array]=`${i} ${l}`}(f,i,l,s,!1)}const Dn=()=>({...wn(),attrs:{}}),zn=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Ln(e,t,n,r){const o=c((()=>{const n=Dn();return An(n,t,zn(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};kn(t,e.style,e),o.style={...t,...o.style}}return o}function On(e=!1){return(t,n,r,{latestValues:o},a)=>{const i=(Tn(t)?Ln:xn)(n,o,a,t),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(Ct(o)||!0===n&&kt(o)||!t&&!kt(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),s=t!==m?{...l,...i,ref:r}:{},{children:u}=n,d=c((()=>Jt(u)?u.get():u),[u]);return g(t,{...s,children:d})}}function Nn(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function Mn(e,t,n,r){if("function"==typeof t){const[o,a]=Nn(r);t=t(void 0!==n?n:e.custom,o,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,a]=Nn(r);t=t(void 0!==n?n:e.custom,o,a)}return t}const jn=e=>Array.isArray(e),In=e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue),_n=e=>jn(e)?e[e.length-1]||0:e;function Fn(e){const t=Jt(e)?e.get():e;return In(t)?t.toValue():t}const Vn=e=>(t,n)=>{const r=l(Tt),o=l(ee),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,a){const i={latestValues:Bn(r,o,a,e),renderState:t()};return n&&(i.onMount=e=>n({props:r,current:e,...i}),i.onUpdate=e=>n(e)),i}(e,t,r,o);return n?a():K(a)};function Bn(e,t,n,r){const o={},a=r(e,{});for(const e in a)o[e]=Fn(a[e]);let{initial:i,animate:l}=e;const s=Dt(e),u=zt(e);t&&u&&!s&&!1!==e.inherit&&(void 0===i&&(i=t.initial),void 0===l&&(l=t.animate));let c=!!n&&!1===n.initial;c=c||!1===i;const d=c?l:i;if(d&&"boolean"!=typeof d&&!Pt(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=Mn(e,t[n]);if(r){const{transitionEnd:e,transition:t,...n}=r;for(const e in n){let t=n[e];if(Array.isArray(t)){t=t[c?t.length-1:0]}null!==t&&(o[e]=t)}for(const t in e)o[t]=e[t]}}}return o}function $n(e,t,n){var r;const{style:o}=e,a={};for(const i in o)(Jt(o[i])||t.style&&Jt(t.style[i])||Gt(i,e)||void 0!==(null===(r=null==n?void 0:n.getValue(i))||void 0===r?void 0:r.liveStyle))&&(a[i]=o[i]);return a}const Un={useVisualState:Vn({scrapeMotionValuesFromProps:$n,createRenderState:wn})};function Hn(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(e){t.dimensions={x:0,y:0,width:0,height:0}}}function Wn(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const qn=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 Yn(e,t,n,r){Wn(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(qn.has(n)?n:It(n),t.attrs[n])}function Qn(e,t,n){const r=$n(e,t,n);for(const n in e)if(Jt(e[n])||Jt(t[n])){r[-1!==Xt.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]}return r}const Zn=["x","y","width","height","cx","cy","r"],Xn={useVisualState:Vn({scrapeMotionValuesFromProps:Qn,createRenderState:Dn,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let a=!!e.drag;if(!a)for(const e in o)if(Kt.has(e)){a=!0;break}if(!a)return;let i=!t;if(t)for(let n=0;n<Zn.length;n++){const r=Zn[n];e[r]!==t[r]&&(i=!0)}i&&qe.read((()=>{Hn(n,r),qe.render((()=>{An(r,o,zn(n.tagName),e.transformTemplate),Yn(n,r)}))}))}})};function Kn(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return $t({...Tn(n)?Xn:Un,preloadedFeatures:e,useRender:On(r),createVisualElement:t,Component:n})}}function Gn(e,t,n){const r=e.getProps();return Mn(r,t,void 0!==n?n:r.custom,e)}const Jn=new Set(["width","height","top","left","right","bottom",...Xt]);function er(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,gt(n))}function tr(e,t){const n=e.getValue("willChange");if(r=n,Boolean(Jt(r)&&r.add))return n.add(t);var r}function nr(e){return e.props[_t]}const rr=!1,or=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ar=1e-7,ir=12;function lr(e,t,n,r){if(e===t&&n===r)return fe;const o=t=>function(e,t,n,r,o){let a,i,l=0;do{i=t+(n-t)/2,a=or(i,r,o)-e,a>0?n=i:t=i}while(Math.abs(a)>ar&&++l<ir);return i}(t,0,1,e,n);return e=>0===e||1===e?e:or(o(e),t,r)}const sr=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ur=e=>t=>1-e(1-t),cr=lr(.33,1.53,.69,.99),dr=ur(cr),fr=sr(dr),pr=e=>(e*=2)<1?.5*dr(e):.5*(2-Math.pow(2,-10*(e-1))),hr=e=>1-Math.sin(Math.acos(e)),mr=ur(hr),gr=sr(hr),yr=e=>/^0[^.\s]+$/u.test(e);const vr=e=>Math.round(1e5*e)/1e5,br=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const wr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,kr=(e,t)=>n=>Boolean("string"==typeof n&&wr.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),Cr=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[o,a,i,l]=r.match(br);return{[e]:parseFloat(o),[t]:parseFloat(a),[n]:parseFloat(i),alpha:void 0!==l?parseFloat(l):1}},xr={...nn,transform:e=>Math.round((e=>tn(0,255,e))(e))},Sr={test:kr("rgb","red"),parse:Cr("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+xr.transform(e)+", "+xr.transform(t)+", "+xr.transform(n)+", "+vr(rn.transform(r))+")"};const Tr={test:kr("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:Sr.transform},Pr={test:kr("hsl","hue"),parse:Cr("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+sn.transform(vr(t))+", "+sn.transform(vr(n))+", "+vr(rn.transform(r))+")"},Er={test:e=>Sr.test(e)||Tr.test(e)||Pr.test(e),parse:e=>Sr.test(e)?Sr.parse(e):Pr.test(e)?Pr.parse(e):Tr.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?Sr.transform(e):Pr.transform(e)},Rr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ar="number",Dr="color",zr="var",Lr="var(",Or="${}",Nr=/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 Mr(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let a=0;const i=t.replace(Nr,(e=>(Er.test(e)?(r.color.push(a),o.push(Dr),n.push(Er.parse(e))):e.startsWith(Lr)?(r.var.push(a),o.push(zr),n.push(e)):(r.number.push(a),o.push(Ar),n.push(parseFloat(e))),++a,Or))).split(Or);return{values:n,split:i,indexes:r,types:o}}function jr(e){return Mr(e).values}function Ir(e){const{split:t,types:n}=Mr(e),r=t.length;return e=>{let o="";for(let a=0;a<r;a++)if(o+=t[a],void 0!==e[a]){const t=n[a];o+=t===Ar?vr(e[a]):t===Dr?Er.transform(e[a]):e[a]}return o}}const _r=e=>"number"==typeof e?0:e;const Fr={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(br))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Rr))||void 0===n?void 0:n.length)||0)>0},parse:jr,createTransformer:Ir,getAnimatableNone:function(e){const t=jr(e);return Ir(e)(t.map(_r))}},Vr=new Set(["brightness","contrast","saturate","opacity"]);function Br(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(br)||[];if(!r)return e;const o=n.replace(r,"");let a=Vr.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+o+")"}const $r=/\b([a-z-]*)\(.*?\)/gu,Ur={...Fr,getAnimatableNone:e=>{const t=e.match($r);return t?t.map(Br).join(" "):e}},Hr={...gn,color:Er,backgroundColor:Er,outlineColor:Er,fill:Er,stroke:Er,borderColor:Er,borderTopColor:Er,borderRightColor:Er,borderBottomColor:Er,borderLeftColor:Er,filter:Ur,WebkitFilter:Ur},Wr=e=>Hr[e];function qr(e,t){let n=Wr(e);return n!==Ur&&(n=Fr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Yr=new Set(["auto","none","0"]);const Qr=e=>180*e/Math.PI,Zr=e=>{const t=Qr(Math.atan2(e[1],e[0]));return Kr(t)},Xr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Zr,rotateZ:Zr,skewX:e=>Qr(Math.atan(e[1])),skewY:e=>Qr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Kr=e=>((e%=360)<0&&(e+=360),e),Gr=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Jr=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),eo={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Gr,scaleY:Jr,scale:e=>(Gr(e)+Jr(e))/2,rotateX:e=>Kr(Qr(Math.atan2(e[6],e[5]))),rotateY:e=>Kr(Qr(Math.atan2(-e[2],e[0]))),rotateZ:Zr,rotate:Zr,skewX:e=>Qr(Math.atan(e[4])),skewY:e=>Qr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function to(e){return e.includes("scale")?1:0}function no(e,t){if(!e||"none"===e)return to(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=eo,o=n;else{const t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Xr,o=t}if(!o)return to(t);const a=r[t],i=o[1].split(",").map(ro);return"function"==typeof a?a(i):i[a]}function ro(e){return parseFloat(e.trim())}const oo=e=>e===nn||e===un,ao=new Set(["x","y","z"]),io=Xt.filter((e=>!ao.has(e)));const lo={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:(e,{transform:t})=>no(t,"x"),y:(e,{transform:t})=>no(t,"y")};lo.translateX=lo.x,lo.translateY=lo.y;const so=new Set;let uo=!1,co=!1;function fo(){if(co){const e=Array.from(so).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return io.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}co=!1,uo=!1,so.forEach((e=>e.complete())),so.clear()}function po(){so.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(co=!0)}))}class ho{constructor(e,t,n,r,o,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(so.add(this),uo||(uo=!0,qe.read(po),qe.resolveKeyframes(fo))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;o<e.length;o++)if(null===e[o])if(0===o){const o=null==r?void 0:r.get(),a=e[e.length-1];if(void 0!==o)e[0]=o;else if(n&&t){const r=n.readValue(t,a);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=a),r&&void 0===o&&r.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),so.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,so.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const mo=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),go=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yo(e,t,n=1){he(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=go.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const e=a.trim();return mo(e)?parseFloat(e):e}return Yt(o)?yo(o,t,n+1):o}const vo=e=>t=>t.test(e),bo=[nn,un,sn,ln,dn,cn,{test:e=>"auto"===e,parse:e=>e}],wo=e=>bo.find(vo(e));class ko extends ho{constructor(e,t,n,r,o){super(e,t,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if("string"==typeof r&&(r=r.trim(),Yt(r))){const o=yo(r,t.current);void 0!==o&&(e[n]=o),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Jn.has(n)||2!==e.length)return;const[r,o]=e,a=wo(r),i=wo(o);if(a!==i)if(oo(a)&&oo(i))for(let t=0;t<e.length;t++){const n=e[t];"string"==typeof n&&(e[t]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)("number"==typeof(r=e[t])?0===r:null===r||"none"===r||"0"===r||yr(r))&&n.push(t);var r;n.length&&function(e,t,n){let r,o=0;for(;o<e.length&&!r;){const t=e[o];"string"==typeof t&&!Yr.has(t)&&Mr(t).values.length&&(r=e[o]),o++}if(r&&n)for(const o of t)e[o]=qr(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=lo[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){var e;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const a=r.length-1,i=r[a];r[a]=lo[n](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),(null===(e=this.removedTransforms)||void 0===e?void 0:e.length)&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const Co=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Fr.test(e)&&"0"!==e||e.startsWith("url(")));function xo(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const a=e[e.length-1],i=Co(o,t),l=Co(a,t);return pe(i===l,`You are trying to animate ${t} from "${o}" to "${a}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${a} via the \`style\` property.`),!(!i||!l)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||Le(n))&&r)}const So=e=>null!==e;function To(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(So),a=t&&"loop"!==n&&t%2==1?0:o.length-1;return a&&void 0!==r?r:o[a]}class Po{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat: