@naisutech/react-tree
Version:
a hierarchical tree component for React written in Typescript
1 lines • 113 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("styled-components");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function o(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i=n(t),r=o(t),s=n(e),a=function(){return a=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},a.apply(this,arguments)};function l(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function u(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}const d=t.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),h=t.createContext({});const p=t.createContext(null),m="undefined"!=typeof document,f=m?t.useLayoutEffect:t.useEffect,g=t.createContext({strict:!1});function v(e,n,o,i){const r=t.useContext(h).visualElement,s=t.useContext(g),a=t.useContext(p),l=t.useContext(d).reducedMotion,c=t.useRef(void 0);i=i||s.renderer,!c.current&&i&&(c.current=i(e,{visualState:n,parent:r,props:o,presenceId:a?a.id:void 0,blockInitialAnimation:!!a&&!1===a.initial,reducedMotionConfig:l}));const u=c.current;return f((()=>{u&&u.syncRender()})),t.useEffect((()=>{u&&u.animationState&&u.animationState.animateChanges()})),f((()=>()=>u&&u.notifyUnmount()),[]),u}function y(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function x(t){return"string"==typeof t||Array.isArray(t)}function b(t){return"object"==typeof t&&"function"==typeof t.start}const w=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function E(t){return b(t.animate)||w.some((e=>x(t[e])))}function S(t){return Boolean(E(t)||t.variants)}function T(e){const{initial:n,animate:o}=function(t,e){if(E(t)){const{initial:e,animate:n}=t;return{initial:!1===e||x(e)?e:void 0,animate:x(n)?n:void 0}}return!1!==t.inherit?e:{}}(e,t.useContext(h));return t.useMemo((()=>({initial:n,animate:o})),[C(n),C(o)])}function C(t){return Array.isArray(t)?t.join(" "):t}const A=t=>({isEnabled:e=>t.some((t=>!!e[t]))}),P={measureLayout:A(["layout","layoutId","drag"]),animation:A(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:A(["exit"]),drag:A(["drag","dragControls"]),focus:A(["whileFocus"]),hover:A(["whileHover","onHoverStart","onHoverEnd"]),tap:A(["whileTap","onTap","onTapStart","onTapCancel"]),pan:A(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:A(["whileInView","onViewportEnter","onViewportLeave"])};function V(t){for(const e in t)"projectionNodeConstructor"===e?P.projectionNodeConstructor=t[e]:P[e].Component=t[e]}function L(e){const n=t.useRef(null);return null===n.current&&(n.current=e()),n.current}const M={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let R=1;const O=t.createContext({});class k extends i.default.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:e}=this.props;return t&&t.setProps(e),null}componentDidUpdate(){}render(){return this.props.children}}const D=t.createContext({}),j=Symbol.for("motionComponentSymbol");function I({preloadedFeatures:e,createVisualElement:n,projectionNodeConstructor:o,useRender:i,useVisualState:s,Component:a}){e&&V(e);const l=t.forwardRef((function(l,c){const u={...t.useContext(d),...l,layoutId:$(l)},{isStatic:p}=u;let f=null;const x=T(l),b=p?void 0:L((()=>{if(M.hasEverUpdated)return R++})),w=s(l,p);if(!p&&m){x.visualElement=v(a,w,u,n);const i=t.useContext(g).strict,r=t.useContext(D);x.visualElement&&(f=x.visualElement.loadFeatures(u,i,e,b,o||P.projectionNodeConstructor,r))}return r.createElement(k,{visualElement:x.visualElement,props:u},f,r.createElement(h.Provider,{value:x},i(a,l,b,function(e,n,o){return t.useCallback((t=>{t&&e.mount&&e.mount(t),n&&(t?n.mount(t):n.unmount()),o&&("function"==typeof o?o(t):y(o)&&(o.current=t))}),[n])}(w,x.visualElement,c),w,p,x.visualElement)))}));return l[j]=a,l}function $({layoutId:e}){const n=t.useContext(O).id;return n&&void 0!==e?n+"-"+e:e}function N(t){function e(e,n={}){return I(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const F=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function B(t){return"string"==typeof t&&!t.includes("-")&&!!(F.indexOf(t)>-1||/[A-Z]/.test(t))}const U={};const z=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],H=new Set(z);function Y(t,{layout:e,layoutId:n}){return H.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!U[t]||"opacity"===t)}const W=t=>!!(null==t?void 0:t.getVelocity),X={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},G=(t,e)=>z.indexOf(t)-z.indexOf(e);function q(t){return t.startsWith("--")}const K=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Z=(t,e)=>n=>Math.max(Math.min(n,e),t),_=t=>t%1?Number(t.toFixed(5)):t,J=/(-)?([\d]*\.?[\d])+/g,Q=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,tt=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function et(t){return"string"==typeof t}const nt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},ot=Object.assign(Object.assign({},nt),{transform:Z(0,1)}),it=Object.assign(Object.assign({},nt),{default:1}),rt=t=>({test:e=>et(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),st=rt("deg"),at=rt("%"),lt=rt("px"),ct=rt("vh"),ut=rt("vw"),dt=Object.assign(Object.assign({},at),{parse:t=>at.parse(t)/100,transform:t=>at.transform(100*t)}),ht=(t,e)=>n=>Boolean(et(n)&&tt.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),pt=(t,e,n)=>o=>{if(!et(o))return o;const[i,r,s,a]=o.match(J);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},mt={test:ht("hsl","hue"),parse:pt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+at.transform(_(e))+", "+at.transform(_(n))+", "+_(ot.transform(o))+")"},ft=Z(0,255),gt=Object.assign(Object.assign({},nt),{transform:t=>Math.round(ft(t))}),vt={test:ht("rgb","red"),parse:pt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+gt.transform(t)+", "+gt.transform(e)+", "+gt.transform(n)+", "+_(ot.transform(o))+")"};const yt={test:ht("#"),parse:function(t){let e="",n="",o="",i="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),i=t.substr(4,1),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:vt.transform},xt={test:t=>vt.test(t)||yt.test(t)||mt.test(t),parse:t=>vt.test(t)?vt.parse(t):mt.test(t)?mt.parse(t):yt.parse(t),transform:t=>et(t)?t:t.hasOwnProperty("red")?vt.transform(t):mt.transform(t)};function bt(t){"number"==typeof t&&(t=`${t}`);const e=[];let n=0;const o=t.match(Q);o&&(n=o.length,t=t.replace(Q,"${c}"),e.push(...o.map(xt.parse)));const i=t.match(J);return i&&(t=t.replace(J,"${n}"),e.push(...i.map(nt.parse))),{values:e,numColors:n,tokenised:t}}function wt(t){return bt(t).values}function Et(t){const{values:e,numColors:n,tokenised:o}=bt(t),i=e.length;return t=>{let e=o;for(let o=0;o<i;o++)e=e.replace(o<n?"${c}":"${n}",o<n?xt.transform(t[o]):_(t[o]));return e}}const St=t=>"number"==typeof t?0:t;const Tt={test:function(t){var e,n,o,i;return isNaN(t)&&et(t)&&(null!==(n=null===(e=t.match(J))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(i=null===(o=t.match(Q))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:wt,createTransformer:Et,getAnimatableNone:function(t){const e=wt(t);return Et(t)(e.map(St))}},Ct=new Set(["brightness","contrast","saturate","opacity"]);function At(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(J)||[];if(!o)return t;const i=n.replace(o,"");let r=Ct.has(e)?1:0;return o!==n&&(r*=100),e+"("+r+i+")"}const Pt=/([a-z-]*)\(.*?\)/g,Vt=Object.assign(Object.assign({},Tt),{getAnimatableNone:t=>{const e=t.match(Pt);return e?e.map(At).join(" "):t}}),Lt={...nt,transform:Math.round},Mt={borderWidth:lt,borderTopWidth:lt,borderRightWidth:lt,borderBottomWidth:lt,borderLeftWidth:lt,borderRadius:lt,radius:lt,borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomRightRadius:lt,borderBottomLeftRadius:lt,width:lt,maxWidth:lt,height:lt,maxHeight:lt,size:lt,top:lt,right:lt,bottom:lt,left:lt,padding:lt,paddingTop:lt,paddingRight:lt,paddingBottom:lt,paddingLeft:lt,margin:lt,marginTop:lt,marginRight:lt,marginBottom:lt,marginLeft:lt,rotate:st,rotateX:st,rotateY:st,rotateZ:st,scale:it,scaleX:it,scaleY:it,scaleZ:it,skew:st,skewX:st,skewY:st,distance:lt,translateX:lt,translateY:lt,translateZ:lt,x:lt,y:lt,z:lt,perspective:lt,transformPerspective:lt,opacity:ot,originX:dt,originY:dt,originZ:lt,zIndex:Lt,fillOpacity:ot,strokeOpacity:ot,numOctaves:Lt};function Rt(t,e,n,o){const{style:i,vars:r,transform:s,transformKeys:a,transformOrigin:l}=t;a.length=0;let c=!1,u=!1,d=!0;for(const t in e){const n=e[t];if(q(t)){r[t]=n;continue}const o=Mt[t],h=K(n,o);if(H.has(t)){if(c=!0,s[t]=h,a.push(t),!d)continue;n!==(o.default||0)&&(d=!1)}else t.startsWith("origin")?(u=!0,l[t]=h):i[t]=h}if(e.transform||(c||o?i.transform=function({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},i,r){let s="";e.sort(G);for(const n of e)s+=`${X[n]||n}(${t[n]}) `;return n&&!t.z&&(s+="translateZ(0)"),s=s.trim(),r?s=r(t,i?"":s):o&&i&&(s="none"),s}(t,n,d,o):i.transform&&(i.transform="none")),u){const{originX:t="50%",originY:e="50%",originZ:n=0}=l;i.transformOrigin=`${t} ${e} ${n}`}}const Ot=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function kt(t,e,n){for(const o in e)W(e[o])||Y(o,n)||(t[o]=e[o])}function Dt(e,n,o){const i={};return kt(i,e.style||{},e),Object.assign(i,function({transformTemplate:e},n,o){return t.useMemo((()=>{const t={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return Rt(t,n,{enableHardwareAcceleration:!o},e),Object.assign({},t.vars,t.style)}),[n])}(e,n,o)),e.transformValues?e.transformValues(i):i}function jt(t,e,n){const o={},i=Dt(t,e,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}const It=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function $t(t){return It.has(t)}let Nt=t=>!$t(t);try{(Ft=require("@emotion/is-prop-valid").default)&&(Nt=t=>t.startsWith("on")?!$t(t):Ft(t))}catch(t){}var Ft;function Bt(t,e,n){return"string"==typeof t?t:lt.transform(e+n*t)}const Ut={offset:"stroke-dashoffset",array:"stroke-dasharray"},zt={offset:"strokeDashoffset",array:"strokeDasharray"};function Ht(t,{attrX:e,attrY:n,originX:o,originY:i,pathLength:r,pathSpacing:s=1,pathOffset:a=0,...l},c,u){Rt(t,l,c,u),t.attrs=t.style,t.style={};const{attrs:d,style:h,dimensions:p}=t;d.transform&&(p&&(h.transform=d.transform),delete d.transform),p&&(void 0!==o||void 0!==i||h.transform)&&(h.transformOrigin=function(t,e,n){return`${Bt(e,t.x,t.width)} ${Bt(n,t.y,t.height)}`}(p,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==r&&function(t,e,n=1,o=0,i=!0){t.pathLength=1;const r=i?Ut:zt;t[r.offset]=lt.transform(-o);const s=lt.transform(e),a=lt.transform(n);t[r.array]=`${s} ${a}`}(d,r,s,a,!1)}const Yt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}});function Wt(e,n){const o=t.useMemo((()=>{const t={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return Ht(t,n,{enableHardwareAcceleration:!1},e.transformTemplate),{...t.attrs,style:{...t.style}}}),[n]);if(e.style){const t={};kt(t,e.style,e),o.style={...t,...o.style}}return o}function Xt(e=!1){return(n,o,i,r,{latestValues:s},a)=>{const l=(B(n)?Wt:jt)(o,s,a),c=function(t,e,n){const o={};for(const i in t)(Nt(i)||!0===n&&$t(i)||!e&&!$t(i)||t.draggable&&i.startsWith("onDrag"))&&(o[i]=t[i]);return o}(o,"string"==typeof n,e),u={...c,...l,ref:r};return i&&(u["data-projection-id"]=i),t.createElement(n,u)}}const Gt=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function qt(t,{style:e,vars:n},o,i){Object.assign(t.style,e,i&&i.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const Kt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function Zt(t,e,n,o){qt(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(Kt.has(n)?n:Gt(n),e.attrs[n])}function _t(t){const{style:e}=t,n={};for(const o in e)(W(e[o])||Y(o,t))&&(n[o]=e[o]);return n}function Jt(t){const e=_t(t);for(const n in t)if(W(t[n])){e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function Qt(t,e,n,o={},i={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),e}const te=t=>Array.isArray(t),ee=t=>te(t)?t[t.length-1]||0:t;function ne(t){const e=W(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const oe=e=>(n,o)=>{const i=t.useContext(h),r=t.useContext(p),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,i,r){const s={latestValues:ie(o,i,r,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}(e,n,i,r);return o?s():L(s)};function ie(t,e,n,o){const i={},r=o(t);for(const t in r)i[t]=ne(r[t]);let{initial:s,animate:a}=t;const l=E(t),c=S(t);e&&c&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===s;const d=u?a:s;if(d&&"boolean"!=typeof d&&!b(d)){(Array.isArray(d)?d:[d]).forEach((e=>{const n=Qt(t,e);if(!n)return;const{transitionEnd:o,transition:r,...s}=n;for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(i[t]=e)}for(const t in o)i[t]=o[t]}))}return i}const re={useVisualState:oe({scrapeMotionValuesFromProps:Jt,createRenderState:Yt,onMount:(t,e,{renderState:n,latestValues:o})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}Ht(n,o,{enableHardwareAcceleration:!1},t.transformTemplate),Zt(e,n)}})},se={useVisualState:oe({scrapeMotionValuesFromProps:_t,createRenderState:Ot})};var ae;function le(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function ce(e,n,o,i){t.useEffect((()=>{const t=e.current;if(o&&t)return le(t,n,o,i)}),[e,n,o,i])}function ue(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function de(t){return!!t.touches}!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(ae||(ae={}));const he={pageX:0,pageY:0};function pe(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||he;return{x:n[e+"X"],y:n[e+"Y"]}}function me(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function fe(t,e="page"){return{point:de(t)?pe(t,e):me(t,e)}}const ge=(t,e=!1)=>{const n=e=>t(e,fe(e));return e?(o=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&o(t)}):n;var o},ve={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},ye={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function xe(t){return m&&null===window.onpointerdown?t:m&&null===window.ontouchstart?ye[t]:m&&null===window.onmousedown?ve[t]:t}function be(t,e,n,o){return le(t,xe(e),ge(n,"pointerdown"===e),o)}function we(t,e,n,o){return ce(t,xe(e),n&&ge(n,"pointerdown"===e),o)}function Ee(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Se=Ee("dragHorizontal"),Te=Ee("dragVertical");function Ce(t){let e=!1;if("y"===t)e=Te();else if("x"===t)e=Se();else{const t=Se(),n=Te();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Ae(){const t=Ce(!0);return!t||(t(),!1)}function Pe(t,e,n){return(o,i)=>{ue(o)&&!Ae()&&(t.animationState&&t.animationState.setActive(ae.Hover,e),n&&n(o,i))}}const Ve=(t,e)=>!!e&&(t===e||Ve(t,e.parentElement));function Le(e){return t.useEffect((()=>()=>e()),[])}var Me=function(){},Re=function(){};"production"!==process.env.NODE_ENV&&(Me=function(t,e){t||"undefined"==typeof console||console.warn(e)},Re=function(t,e){if(!t)throw new Error(e)});const Oe=(t,e,n)=>Math.min(Math.max(n,t),e);function ke({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let i,r;Me(t<=1e4,"Spring duration must be 10 seconds or less");let s=1-e;s=Oe(.05,1,s),t=Oe(.01,10,t/1e3),s<1?(i=e=>{const o=e*s,i=o*t;return.001-(o-n)/De(e,s)*Math.exp(-i)},r=e=>{const o=e*s*t,r=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),c=De(Math.pow(e,2),s);return(.001-i(e)>0?-1:1)*((r-a)*l)/c}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let o=n;for(let n=1;n<12;n++)o-=t(o)/e(o);return o}(i,r,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*o;return{stiffness:e,damping:2*s*Math.sqrt(o*e),duration:t}}}function De(t,e){return t*Math.sqrt(1-e*e)}const je=["duration","bounce"],Ie=["stiffness","damping","mass"];function $e(t,e){return e.some((e=>void 0!==t[e]))}function Ne(t){var{from:e=0,to:n=1,restSpeed:o=2,restDelta:i}=t,r=l(t,["from","to","restSpeed","restDelta"]);const s={done:!1,value:e};let{stiffness:a,damping:c,mass:u,velocity:d,duration:h,isResolvedFromDuration:p}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!$e(t,Ie)&&$e(t,je)){const n=ke(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(r),m=Fe,f=Fe;function g(){const t=d?-d/1e3:0,o=n-e,r=c/(2*Math.sqrt(a*u)),s=Math.sqrt(a/u)/1e3;if(void 0===i&&(i=Math.min(Math.abs(n-e)/100,.4)),r<1){const e=De(s,r);m=i=>{const a=Math.exp(-r*s*i);return n-a*((t+r*s*o)/e*Math.sin(e*i)+o*Math.cos(e*i))},f=n=>{const i=Math.exp(-r*s*n);return r*s*i*(Math.sin(e*n)*(t+r*s*o)/e+o*Math.cos(e*n))-i*(Math.cos(e*n)*(t+r*s*o)-e*o*Math.sin(e*n))}}else if(1===r)m=e=>n-Math.exp(-s*e)*(o+(t+s*o)*e);else{const e=s*Math.sqrt(r*r-1);m=i=>{const a=Math.exp(-r*s*i),l=Math.min(e*i,300);return n-a*((t+r*s*o)*Math.sinh(l)+e*o*Math.cosh(l))/e}}}return g(),{next:t=>{const e=m(t);if(p)s.done=t>=h;else{const r=1e3*f(t),a=Math.abs(r)<=o,l=Math.abs(n-e)<=i;s.done=a&&l}return s.value=s.done?n:e,s},flipTarget:()=>{d=-d,[e,n]=[n,e],g()}}}Ne.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const Fe=t=>0,Be=(t,e,n)=>{const o=e-t;return 0===o?1:(n-t)/o},Ue=(t,e,n)=>-n*t+n*e+t;function ze(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function He({hue:t,saturation:e,lightness:n,alpha:o}){t/=360,n/=100;let i=0,r=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;i=ze(a,o,t+1/3),r=ze(a,o,t),s=ze(a,o,t-1/3)}else i=r=s=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*s),alpha:o}}const Ye=(t,e,n)=>{const o=t*t,i=e*e;return Math.sqrt(Math.max(0,n*(i-o)+o))},We=[yt,vt,mt],Xe=t=>We.find((e=>e.test(t))),Ge=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,qe=(t,e)=>{let n=Xe(t),o=Xe(e);Re(!!n,Ge(t)),Re(!!o,Ge(e));let i=n.parse(t),r=o.parse(e);n===mt&&(i=He(i),n=vt),o===mt&&(r=He(r),o=vt);const s=Object.assign({},i);return t=>{for(const e in s)"alpha"!==e&&(s[e]=Ye(i[e],r[e],t));return s.alpha=Ue(i.alpha,r.alpha,t),n.transform(s)}},Ke=t=>"number"==typeof t,Ze=(t,e)=>n=>e(t(n)),_e=(...t)=>t.reduce(Ze);function Je(t,e){return Ke(t)?n=>Ue(t,e,n):xt.test(t)?qe(t,e):nn(t,e)}const Qe=(t,e)=>{const n=[...t],o=n.length,i=t.map(((t,n)=>Je(t,e[n])));return t=>{for(let e=0;e<o;e++)n[e]=i[e](t);return n}},tn=(t,e)=>{const n=Object.assign(Object.assign({},t),e),o={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=Je(t[i],e[i]));return t=>{for(const e in o)n[e]=o[e](t);return n}};function en(t){const e=Tt.parse(t),n=e.length;let o=0,i=0,r=0;for(let t=0;t<n;t++)o||"number"==typeof e[t]?o++:void 0!==e[t].hue?r++:i++;return{parsed:e,numNumbers:o,numRGB:i,numHSL:r}}const nn=(t,e)=>{const n=Tt.createTransformer(e),o=en(t),i=en(e);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&o.numNumbers>=i.numNumbers?_e(Qe(o.parsed,i.parsed),n):(Me(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),n=>`${n>0?e:t}`)},on=(t,e)=>n=>Ue(t,e,n);function rn(t,e,n){const o=[],i=n||("number"==typeof(r=t[0])?on:"string"==typeof r?xt.test(r)?qe:nn:Array.isArray(r)?Qe:"object"==typeof r?tn:void 0);var r;const s=t.length-1;for(let n=0;n<s;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;r=_e(t,r)}o.push(r)}return o}function sn(t,e,{clamp:n=!0,ease:o,mixer:i}={}){const r=t.length;Re(r===e.length,"Both input and output ranges must be the same length"),Re(!o||!Array.isArray(o)||o.length===r-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[r-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const s=rn(e,o,i),a=2===r?function([t,e],[n]){return o=>n(Be(t,e,o))}(t,s):function(t,e){const n=t.length,o=n-1;return i=>{let r=0,s=!1;if(i<=t[0]?s=!0:i>=t[o]&&(r=o-1,s=!0),!s){let e=1;for(;e<n&&!(t[e]>i||e===o);e++);r=e-1}const a=Be(t[r],t[r+1],i);return e[r](a)}}(t,s);return n?e=>a(Oe(t[0],t[r-1],e)):a}const an=t=>e=>1-t(1-e),ln=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,cn=t=>e=>e*e*((t+1)*e-t),un=t=>t,dn=(hn=2,t=>Math.pow(t,hn));var hn;const pn=an(dn),mn=ln(dn),fn=t=>1-Math.sin(Math.acos(t)),gn=an(fn),vn=ln(gn),yn=cn(1.525),xn=an(yn),bn=ln(yn),wn=(t=>{const e=cn(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),En=t=>{if(1===t||0===t)return t;const e=t*t;return t<.36363636363636365?7.5625*e:t<.7272727272727273?9.075*e-9.9*t+3.4:t<.9?12.066481994459833*e-19.63545706371191*t+8.898060941828255:10.8*t*t-20.52*t+10.72},Sn=an(En);function Tn(t,e){return t.map((()=>e||mn)).splice(0,t.length-1)}function Cn({from:t=0,to:e=1,ease:n,offset:o,duration:i=300}){const r={done:!1,value:t},s=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map((t=>t*e))}(o&&o.length===s.length?o:function(t){const e=t.length;return t.map(((t,n)=>0!==n?n/(e-1):0))}(s),i);function l(){return sn(a,s,{ease:Array.isArray(n)?n:Tn(s,n)})}let c=l();return{next:t=>(r.value=c(t),r.done=t>=i,r),flipTarget:()=>{s.reverse(),c=l()}}}const An={keyframes:Cn,spring:Ne,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:o=350,restDelta:i=.5,modifyTarget:r}){const s={done:!1,value:e};let a=n*t;const l=e+a,c=void 0===r?l:r(l);return c!==l&&(a=c-e),{next:t=>{const e=-a*Math.exp(-t/o);return s.done=!(e>i||e<-i),s.value=s.done?c:c+e,s},flipTarget:()=>{}}}};const Pn="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),Vn="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout((()=>t(Pn())),16.666666666666668);let Ln=!0,Mn=!1,Rn=!1;const On={delta:0,timestamp:0},kn=["read","update","preRender","render","postRender"],Dn=kn.reduce(((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,i=!1,r=!1;const s=new WeakSet,a={schedule:(t,r=!1,a=!1)=>{const l=a&&i,c=l?e:n;return r&&s.add(t),-1===c.indexOf(t)&&(c.push(t),l&&i&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(i)r=!0;else{if(i=!0,[e,n]=[n,e],n.length=0,o=e.length,o)for(let n=0;n<o;n++){const o=e[n];o(l),s.has(o)&&(a.schedule(o),t())}i=!1,r&&(r=!1,a.process(l))}}};return a}((()=>Mn=!0)),t)),{}),jn=kn.reduce(((t,e)=>{const n=Dn[e];return t[e]=(t,e=!1,o=!1)=>(Mn||Bn(),n.schedule(t,e,o)),t}),{}),In=kn.reduce(((t,e)=>(t[e]=Dn[e].cancel,t)),{}),$n=kn.reduce(((t,e)=>(t[e]=()=>Dn[e].process(On),t)),{}),Nn=t=>Dn[t].process(On),Fn=t=>{Mn=!1,On.delta=Ln?16.666666666666668:Math.max(Math.min(t-On.timestamp,40),1),On.timestamp=t,Rn=!0,kn.forEach(Nn),Rn=!1,Mn&&(Ln=!1,Vn(Fn))},Bn=()=>{Mn=!0,Ln=!0,Rn||Vn(Fn)},Un=()=>On;function zn(t,e,n=0){return t-e-n}const Hn=t=>{const e=({delta:e})=>t(e);return{start:()=>jn.update(e,!0),stop:()=>In.update(e)}};function Yn(t){var e,n,{from:o,autoplay:i=!0,driver:r=Hn,elapsed:s=0,repeat:a=0,repeatType:c="loop",repeatDelay:u=0,onPlay:d,onStop:h,onComplete:p,onRepeat:m,onUpdate:f}=t,g=l(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let v,y,x,{to:b}=g,w=0,E=g.duration,S=!1,T=!0;const C=function(t){if(Array.isArray(t.to))return Cn;if(An[t.type])return An[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Cn:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Ne:Cn}(g);(null===(n=(e=C).needsInterpolation)||void 0===n?void 0:n.call(e,o,b))&&(x=sn([0,100],[o,b],{clamp:!1}),o=0,b=100);const A=C(Object.assign(Object.assign({},g),{from:o,to:b}));function P(){w++,"reverse"===c?(T=w%2==0,s=function(t,e,n=0,o=!0){return o?zn(e+-t,e,n):e-(t-e)+n}(s,E,u,T)):(s=zn(s,E,u),"mirror"===c&&A.flipTarget()),S=!1,m&&m()}function V(t){if(T||(t=-t),s+=t,!S){const t=A.next(Math.max(0,s));y=t.value,x&&(y=x(y)),S=T?t.done:s<=0}null==f||f(y),S&&(0===w&&(null!=E||(E=s)),w<a?function(t,e,n,o){return o?t>=e+n:t<=-n}(s,E,u,T)&&P():(v.stop(),p&&p()))}return i&&(null==d||d(),v=r(V),v.start()),{stop:()=>{null==h||h(),v.stop()}}}function Wn(t,e){return e?t*(1e3/e):0}const Xn=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),Gn=t=>Xn(t)&&t.hasOwnProperty("z"),qn=(t,e)=>Math.abs(t-e);function Kn(t,e){if(Ke(t)&&Ke(e))return qn(t,e);if(Xn(t)&&Xn(e)){const n=qn(t.x,e.x),o=qn(t.y,e.y),i=Gn(t)&&Gn(e)?qn(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}const Zn=(t,e)=>1-3*e+3*t,_n=(t,e)=>3*e-6*t,Jn=t=>3*t,Qn=(t,e,n)=>((Zn(e,n)*t+_n(e,n))*t+Jn(e))*t,to=(t,e,n)=>3*Zn(e,n)*t*t+2*_n(e,n)*t+Jn(e);function eo(t,e,n,o){if(t===e&&n===o)return un;const i=new Float32Array(11);for(let e=0;e<11;++e)i[e]=Qn(.1*e,t,n);function r(e){let o=0,r=1;for(;10!==r&&i[r]<=e;++r)o+=.1;--r;const s=o+.1*((e-i[r])/(i[r+1]-i[r])),a=to(s,t,n);return a>=.001?function(t,e,n,o){for(let i=0;i<8;++i){const i=to(e,n,o);if(0===i)return e;e-=(Qn(e,n,o)-t)/i}return e}(e,s,t,n):0===a?s:function(t,e,n,o,i){let r,s,a=0;do{s=e+(n-e)/2,r=Qn(s,o,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++a<10);return s}(e,o,o+.1,t,n)}return t=>0===t||1===t?t:Qn(r(t),e,o)}const no="undefined"==typeof process||void 0===process.env?"production":process.env.NODE_ENV||"production",oo=new Set;function io(t,e,n){t||oo.has(e)||(console.warn(e),n&&console.warn(n),oo.add(e))}const ro=new WeakMap,so=new WeakMap,ao=t=>{const e=ro.get(t.target);e&&e(t)},lo=t=>{t.forEach(ao)};function co(t,e,n){const o=function({root:t,...e}){const n=t||document;so.has(n)||so.set(n,{});const o=so.get(n),i=JSON.stringify(e);return o[i]||(o[i]=new IntersectionObserver(lo,{root:t,...e})),o[i]}(e);return ro.set(t,n),o.observe(t),()=>{ro.delete(t),o.unobserve(t)}}const uo={some:0,all:1};function ho(e,n,o,{root:i,margin:r,amount:s="some",once:a}){t.useEffect((()=>{if(!e)return;const t={root:null==i?void 0:i.current,rootMargin:r,threshold:"number"==typeof s?s:uo[s]};return co(o.getInstance(),t,(t=>{const{isIntersecting:e}=t;if(n.isInView===e)return;if(n.isInView=e,a&&!e&&n.hasEnteredView)return;e&&(n.hasEnteredView=!0),o.animationState&&o.animationState.setActive(ae.InView,e);const i=o.getProps(),r=e?i.onViewportEnter:i.onViewportLeave;r&&r(t)}))}),[e,i,r,s])}function po(e,n,o,{fallback:i=!0}){t.useEffect((()=>{e&&i&&("production"!==no&&io(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame((()=>{n.hasEnteredView=!0;const{onViewportEnter:t}=o.getProps();t&&t(null),o.animationState&&o.animationState.setActive(ae.InView,!0)})))}),[e])}const mo=t=>e=>(t(e),null),fo={inView:mo((function({visualElement:e,whileInView:n,onViewportEnter:o,onViewportLeave:i,viewport:r={}}){const s=t.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||i);r.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?po:ho)(a,s.current,e,r)})),tap:mo((function({onTap:e,onTapStart:n,onTapCancel:o,whileTap:i,visualElement:r}){const s=e||n||o||i,a=t.useRef(!1),l=t.useRef(null),c={passive:!(n||e||o||m)};function u(){l.current&&l.current(),l.current=null}function d(){return u(),a.current=!1,r.animationState&&r.animationState.setActive(ae.Tap,!1),!Ae()}function h(t,n){d()&&(Ve(r.getInstance(),t.target)?e&&e(t,n):o&&o(t,n))}function p(t,e){d()&&o&&o(t,e)}function m(t,e){u(),a.current||(a.current=!0,l.current=_e(be(window,"pointerup",h,c),be(window,"pointercancel",p,c)),r.animationState&&r.animationState.setActive(ae.Tap,!0),n&&n(t,e))}we(r,"pointerdown",s?m:void 0,c),Le(u)})),focus:mo((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;ce(e,"focus",t?()=>{n&&n.setActive(ae.Focus,!0)}:void 0),ce(e,"blur",t?()=>{n&&n.setActive(ae.Focus,!1)}:void 0)})),hover:mo((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:o}){we(o,"pointerenter",t||n?Pe(o,!0,t):void 0,{passive:!t}),we(o,"pointerleave",e||n?Pe(o,!1,e):void 0,{passive:!e})}))};function go(){const e=t.useContext(p);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:o,register:i}=e,r=t.useId();t.useEffect((()=>i(r)),[]);return!n&&o?[!1,()=>o&&o(r)]:[!0]}function vo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}const yo=t=>1e3*t,xo={linear:un,easeIn:dn,easeInOut:mn,easeOut:pn,circIn:fn,circInOut:vn,circOut:gn,backIn:yn,backInOut:bn,backOut:xn,anticipate:wn,bounceIn:Sn,bounceInOut:t=>t<.5?.5*(1-En(1-2*t)):.5*En(2*t-1)+.5,bounceOut:En},bo=t=>{if(Array.isArray(t)){Re(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,o,i]=t;return eo(e,n,o,i)}return"string"==typeof t?(Re(void 0!==xo[t],`Invalid easing type '${t}'`),xo[t]):t},wo=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Tt.test(e)||e.startsWith("url("))),Eo=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),So=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),To=()=>({type:"keyframes",ease:"linear",duration:.3}),Co=t=>({type:"keyframes",duration:.8,values:t}),Ao={x:Eo,y:Eo,z:Eo,rotate:Eo,rotateX:Eo,rotateY:Eo,rotateZ:Eo,scaleX:So,scaleY:So,scale:So,opacity:To,backgroundColor:To,color:To,default:So},Po=(t,e)=>{let n;return n=te(e)?Co:Ao[t]||Ao.default,{to:e,...n(e)}},Vo={...Mt,color:xt,backgroundColor:xt,outlineColor:xt,fill:xt,stroke:xt,borderColor:xt,borderTopColor:xt,borderRightColor:xt,borderBottomColor:xt,borderLeftColor:xt,filter:Vt,WebkitFilter:Vt},Lo=t=>Vo[t];function Mo(t,e){var n;let o=Lo(t);return o!==Vt&&(o=Tt),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const Ro=!1;let Oo=!1;function ko({ease:t,times:e,yoyo:n,flip:o,loop:i,...r}){const s={...r};return e&&(s.offset=e),r.duration&&(s.duration=yo(r.duration)),r.repeatDelay&&(s.repeatDelay=yo(r.repeatDelay)),t&&(s.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(bo):bo(t)),"tween"===r.type&&(s.type="keyframes"),(n||i||o)&&(Me(!Oo,"yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options."),Oo=!0,n?s.repeatType="reverse":i?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=i||n||o||r.repeat),"spring"!==r.type&&(s.type="keyframes"),s}function Do(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:o,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:a,from:l,...c}){return!!Object.keys(c).length}(t)||(t={...t,...Po(n,e.to)}),{...e,...ko(t)}}function jo(t,e,n,o,i){const r=No(o,t)||{};let s=void 0!==r.from?r.from:e.get();const a=wo(t,n);"none"===s&&a&&"string"==typeof n?s=Mo(t,n):Io(s)&&"string"==typeof n?s=$o(n):!Array.isArray(n)&&Io(n)&&"string"==typeof s&&(n=$o(s));const l=wo(t,s);return Me(l===a,`You are trying to animate ${t} from "${s}" to "${n}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${n} via the \`style\` property.`),l&&a&&!1!==r.type?function(){const o={from:s,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:t=>e.set(t)};return"inertia"===r.type||"decay"===r.type?function({from:t=0,velocity:e=0,min:n,max:o,power:i=.8,timeConstant:r=750,bounceStiffness:s=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:c,driver:u,onUpdate:d,onComplete:h,onStop:p}){let m;function f(t){return void 0!==n&&t<n||void 0!==o&&t>o}function g(t){return void 0===n?o:void 0===o||Math.abs(n-t)<Math.abs(o-t)?n:o}function v(t){null==m||m.stop(),m=Yn(Object.assign(Object.assign({},t),{driver:u,onUpdate:e=>{var n;null==d||d(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:h,onStop:p}))}function y(t){v(Object.assign({type:"spring",stiffness:s,damping:a,restDelta:l},t))}if(f(t))y({from:t,velocity:e,to:g(t)});else{let o=i*e+t;void 0!==c&&(o=c(o));const s=g(o),a=s===n?-1:1;let u,d;const h=t=>{u=d,d=t,e=Wn(t-u,Un().delta),(1===a&&t>s||-1===a&&t<s)&&y({from:t,to:s,velocity:e})};v({type:"decay",from:t,velocity:e,timeConstant:r,power:i,restDelta:l,modifyTarget:c,onUpdate:f(o)?h:void 0})}return{stop:()=>null==m?void 0:m.stop()}}({...o,...r}):Yn({...Do(r,o,t),onUpdate:t=>{o.onUpdate(t),r.onUpdate&&r.onUpdate(t)},onComplete:()=>{o.onComplete(),r.onComplete&&r.onComplete()}})}:function(){const t=ee(n);return e.set(t),i(),r.onUpdate&&r.onUpdate(t),r.onComplete&&r.onComplete(),{stop:()=>{}}}}function Io(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function $o(t){return"number"==typeof t?0:Mo("",t)}function No(t,e){return t[e]||t.default||t}function Fo(t,e,n,o={}){return Ro&&(o={type:!1}),e.start((i=>{let r,s;const a=jo(t,e,n,o,i),l=function(t,e){var n,o;return null!==(o=null!==(n=(No(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==o?o:0}(o,t),c=()=>s=a();return l?r=window.setTimeout(c,yo(l)):c(),()=>{clearTimeout(r),s&&s.stop()}}))}const Bo=t=>/^0[^.\s]+$/.test(t);function Uo(t,e){-1===t.indexOf(e)&&t.push(e)}function zo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Ho{constructor(){this.subscriptions=[]}add(t){return Uo(this.subscriptions,t),()=>zo(this.subscriptions,t)}notify(t,e,n){const o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(let i=0;i<o;i++){const o=this.subscriptions[i];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Yo{constructor(t){var e;this.version="7.5.0",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Ho,this.velocityUpdateSubscribers=new Ho,this.renderSubscribers=new Ho,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=Un();this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,jn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>jn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Wn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.stopAnimation=t(e)})).then((()=>this.clearAnimation()))}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Wo(t){return new Yo(t)}const Xo=t=>e=>e.test(t),Go=[nt,lt,at,st,ut,ct,{test:t=>"auto"===t,parse:t=>t}],qo=t=>Go.find(Xo(t)),Ko=[...Go,xt,Tt],Zo=t=>Ko.find(Xo(t));function _o(t,e,n){const o=t.getProps();return Qt(o,e,void 0!==n?n:o.custom,function(t){const e={};return t.forEachValue(((t,n)=>e[n]=t.get())),e}(t),function(t){const e={};return t.forEachValue(((t,n)=>e[n]=t.getVelocity())),e}(t))}function Jo(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Wo(n))}function Qo(t,e){if(!e)return;return(e[t]||e.default||e).from}function ti(t){return Boolean(W(t)&&t.add)}function ei(t,e,n={}){var o;const i=_o(t,e,n.custom);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const s=i?()=>ni(t,i,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=r;return function(t,e,n=0,o=0,i=1,r){const s=[],a=(t.variantChildren.size-1)*o,l=1===i?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(oi).forEach(((t,o)=>{s.push(ei(t,e,{...r,delay:n+l(o)}).then((()=>t.notifyAnimationComplete(e))))})),Promise.all(s)}(t,e,i+o,s,a,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function ni(t,e,{delay:n=0,transitionOverride:o,type:i}={}){var r;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const c=t.getValue("willChange");o&&(s=o);const u=[],d=i&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[i]);for(const e in l){const o=t.getValue(e),i=l[e];if(!o||void 0===i||d&&ii(d,e))continue;let r={delay:n,...s};t.shouldReduceMotion&&H.has(e)&&(r={...r,type:!1,delay:0});let a=Fo(e,o,i,r);ti(c)&&(c.add(e),a=a.then((()=>c.remove(e)))),u.push(a)}return Promise.all(u).then((()=>{a&&function(t,e){const n=_o(t,e);let{transitionEnd:o={},transition:i={},...r}=n?t.makeTargetAnimatable(n,!1):{};r={...r,...o};for(const e in r)Jo(t,e,ee(r[e]))}(t,a)}))}function oi(t,e){return t.sortNodePosition(e)}function ii({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const ri=[ae.Animate,ae.InView,ae.Focus,ae.Hover,ae.Tap,ae.Drag,ae.Exit],si=[...ri].reverse(),ai=ri.length;function li(t){return e=>Promise.all(e.map((({animation:e,options:n})=>function(t,e,n={}){let o;if(t.notifyAnimationStart(e),Array.isArray(e)){const i=e.map((e=>ei(t,e,n)));o=Promise.all(i)}else if("string"==typeof e)o=ei(t,e,n);else{const i="function"==typeof e?_o(t,e,n.custom):e;o=ni(t,i,n)}return o.then((()=>t.notifyAnimationComplete(e)))}(t,e,n))))}function ci(t){let e=li(t);const n={[ae.Animate]:di(!0),[ae.InView]:di(),[ae.Hover]:di(),[ae.Tap]:di(),[ae.Drag]:di(),[ae.Focus]:di(),[ae.Exit]:di()};let o=!0;const i=(e,n)=>{const o=_o(t,n);if(o){const{transition:t,transitionEnd:n,...i}=o;e={...e,...i,...n}}return e};function r(r,s){var a;const l=t.getProps(),c=t.getVariantContext(!0)||{},u=[],d=new Set;let h={},p=1/0;for(let e=0;e<ai;e++){const m=si[e],f=n[m],g=null!==(a=l[m])&&void 0!==a?a:c[m],v=x(g),y=m===s?f.isActive:null;!1===y&&(p=e);let w=g===c[m]&&g!==l[m]&&v;if(w&&o&&t.manuallyAnimateOnMount&&(w=!1),f.protectedKeys={...h},!f.isActive&&null===y||!g&&!f.prevProp||b(g)||"boolean"==typeof g)continue;const E=ui(f.prevProp,g);let S=E||m===s&&f.isActive&&!w&&v||e>p&&v;const T=Array.isArray(g)?g:[g];let C=T.reduce(i,{});!1===y&&(C={});const{prevResolvedValues:A={}}=f,P={...A,...C},V=t=>{S=!0,d.delete(t),f.needsAnimating[t]=!0};for(const t in P){const e=C[t],n=A[t];h.hasOwnProperty(t)||(e!==n?te(e)&&te(n)?!vo(e,n)||E?V(t):f.protectedKeys[t]=!0:void 0!==e?V(t):d.add(t):void 0!==e&&d.has(t)?V(t):f.protectedKeys[t]=!0)}f.prevProp=g,f.prevResolvedValues=C,f.isActive&&(h={...h,...C}),o&&t.blockInitialAnimation&&(S=!1),S&&!w&&u.push(...T.map((t=>({animation:t,options:{type:m,...r}}))))}if(d.size){const e={};d.forEach((n=>{const o=t.getBaseTarget(n);void 0!==o&&(e[n]=o)})),u.push({animation:e})}let m=Boolean(u.length);return o&&!1===l.initial&&!t.manuallyAnimateOnMount&&(m=!1),o=!1,m?e(u):Promise.resolve()}return{animateChanges:r,setActive:function(e,o,i){var s;if(n[e].isActive===o)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach((t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,o)})),n[e].isActive=o;const a=r(i,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function ui(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!vo(e,t)}function di(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const hi={animation:mo((({visualElement:e,animate:n})=>{e.animationState||(e.animationState=ci(e)),b(n)&&t.useEffect((()=>n.subscribe(e)),[n])})),exit:mo((e=>{const{custom:n,visualElement:o}=e,[i,r]=go(),s=t.useContext(p);t.useEffect((()=>{o.isPresent=i;const t=o.animationState&&o.animationState.setActive(ae.Exit,!i,{custom:s&&s.custom||n});t&&!i&&t.then(r)}),[i])}))};class pi{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=gi(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Kn(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:i}=Un();this.history.push({...o,timestamp:i});const{onStart:r,onMove:s}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=mi(e,this.transformPagePoint),ue(t)&&0===t.buttons?this.handlePointerUp(t,e):jn.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:o}=this.handlers,i=gi(mi(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),o&&o(t,i)},de(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const o=mi(fe(t),this.transformPagePoint),{point:i}=o,{timestamp:r}=Un();this.history=[{...i,timestamp:r}];const{onSessionStart:s}=e;s&&s(t,gi(o,this.history)),this.removeListeners=_e(be(window,"pointermove",this.handlePointerMove),be(window,"pointerup",this.handlePointerUp),be(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),In.update(this.updatePoint)}}function mi(t,e){return e?{point:e(t.point)}:t}function fi(t,e){return{x:t.x-e.x,y:t.y-e.y}}function gi({point:t},e){return{point:t,delta:fi(t,yi(e)),offset:fi(t,vi(e)),velocity:xi(e,.1)}}function vi(t){return t[0]}function yi(t){return t[t.length-1]}function xi(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const i=yi(t);for(;n>=0&&(o=t[n],!(i.timestamp-o.timestamp>yo(e)));)n--;if(!o)return{x:0,y:0};const r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};const s={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function bi(t){return t.max-t.min}function wi(t,e=0,n=.01){return Kn(t,e)<n}function Ei(t,e,n,o=.5){t.origin=o,t.originPoint=Ue(e.min,e.max,t.origin),t.scale=bi(n)/bi(e),(wi(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Ue(n.min,n.max,t.origin)-t.originPoint,(wi(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Si(t,e,n,o){Ei(t.x,e.x,n.x,null==o?void 0:o.originX),Ei(t.y,e.y,n.y,null==o?void 0:o.originY)}function Ti(t,e,n){t.min=n.min+e.min,t.max=t.min+bi(e)}function Ci(t,e,n){t.min=e.min-n.min,t.max=t.min+bi(e)}function Ai(t,e,n){Ci(t.x,e.x,n.x),Ci(t.y,e.y,n.y)}function Pi(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Vi(t,e){let n=e.min-t.min,o=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,o]=[o,n]),{min:n,max:o}}const Li=.35;function Mi(t,e,n){return{min:Ri(t,e),max:Ri(t,n)}}function Ri(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}function Oi(t){return[t("x"),t("y")]}function ki({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function Di(t){return void 0===t||1===t}function ji({scale:t,scaleX:e,scaleY:n}){return!Di(t)||!Di(e)||!Di(n)}function Ii(t){return ji(t)||$i(t.x)||$i(t.y)||t.z||t.rotate||t.rotateX||t.rotateY}function $i(t){return t&&"0%"!==t}function Ni(t,e,n){return n+e*(t-n)}function Fi(t,e,n,o,i){return void 0!==i&&(t=Ni(t,i,o)),Ni(t,n,o)+e}function Bi(t,e=0,n=1,o,i){t.min=Fi(t.min,e,n,o,i),t.max=Fi(t.max,e,n,o,i)}function Ui(t,{x:e,y:n}){Bi(t.x,e.translate,e.scale,e.originPoint),Bi(t.y,n.translate,n.scale,n.originPoint)}function zi(t,e){t.min=t.min+e,t.max=t.max+e}function Hi(t,e,[n,o,i]){const r=void 0!==e[i]?e[i]:.5,s=Ue(t.min,t.max,r);Bi(t,e[n],e[o],s,e.scale)}const Yi=["x","scaleX","originX"],Wi=["y","scaleY","originY"];function Xi(t,e){Hi(t.x,e,Yi),Hi(t.y,e,Wi)}function Gi(t,e){return ki(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),o=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}(t.getBoundingClientRect(),e))}const qi=new WeakMap;class Ki{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new pi(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(fe(t,"page").point)},onStart:(t,e)=>{var n;const{drag:o,dragPropagation:i,onDragStart:r}=this.getProps();(!o||i||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Ce(o),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Oi((t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(at.test(o)){const i=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.actual[t];if(i){o=bi(i)*(parseFloat(o)/100)}}this.originPoint[t]=o})),null==r||r(t,e),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(ae.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:o,onDirectionLock:i,onDrag:r}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(o&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(s),void(null!==this.currentDirection&&(null==i||i(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.syncRender(),null==r||r(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:o}=e;this.startAnimation(o);const{onDragEnd:i}=this.getProps();null==i||i(t,e)}cancel(){var t,e;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(t=this.panSession)||void 0===t||t.end(),t