UNPKG

timepick-kit-react

Version:

A flexible timepicker kit for react

1 lines 162 kB
(function(H,L){typeof exports=="object"&&typeof module<"u"?L(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],L):(H=typeof globalThis<"u"?globalThis:H||self,L(H.UniversalTimePicker={},H.jsxRuntime,H.React))})(this,function(H,L,g){"use strict";function Go(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Z=Go(g),zn=g.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),ct=g.createContext({}),dt=g.createContext(null),ft=typeof document<"u",Rt=ft?g.useLayoutEffect:g.useEffect,Gn=g.createContext({strict:!1}),$t=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),_n="data-"+$t("framerAppearId");function _o(e,t,n,r){const{visualElement:i}=g.useContext(ct),s=g.useContext(Gn),o=g.useContext(dt),a=g.useContext(zn).reducedMotion,l=g.useRef();r=r||s.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const u=l.current;g.useInsertionEffect(()=>{u&&u.update(n,o)});const c=g.useRef(!!(n[_n]&&!window.HandoffComplete));return Rt(()=>{u&&(u.render(),c.current&&u.animationState&&u.animationState.animateChanges())}),g.useEffect(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),c.current&&(c.current=!1,window.HandoffComplete=!0))}),u}function Be(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Yo(e,t,n){return g.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Be(n)&&(n.current=r))},[t])}function ze(e){return typeof e=="string"||Array.isArray(e)}function ht(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const zt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Gt=["initial",...zt];function mt(e){return ht(e.animate)||Gt.some(t=>ze(e[t]))}function Yn(e){return!!(mt(e)||e.variants)}function Ho(e,t){if(mt(e)){const{initial:n,animate:r}=e;return{initial:n===!1||ze(n)?n:void 0,animate:ze(r)?r:void 0}}return e.inherit!==!1?t:{}}function qo(e){const{initial:t,animate:n}=Ho(e,g.useContext(ct));return g.useMemo(()=>({initial:t,animate:n}),[Hn(t),Hn(n)])}function Hn(e){return Array.isArray(e)?e.join(" "):e}const qn={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"]},Ge={};for(const e in qn)Ge[e]={isEnabled:t=>qn[e].some(n=>!!t[n])};function Ko(e){for(const t in e)Ge[t]={...Ge[t],...e[t]}}const _t=g.createContext({}),Kn=g.createContext({}),Xo=Symbol.for("motionComponentSymbol");function Zo({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&Ko(e);function s(a,l){let u;const c={...g.useContext(zn),...a,layoutId:Qo(a)},{isStatic:d}=c,f=qo(a),h=r(a,d);if(!d&&ft){f.visualElement=_o(i,h,c,t);const m=g.useContext(Kn),p=g.useContext(Gn).strict;f.visualElement&&(u=f.visualElement.loadFeatures(c,p,e,m))}return Z.createElement(ct.Provider,{value:f},u&&f.visualElement?Z.createElement(u,{visualElement:f.visualElement,...c}):null,n(i,a,Yo(h,f.visualElement,l),h,d,f.visualElement))}const o=g.forwardRef(s);return o[Xo]=i,o}function Qo({layoutId:e}){const t=g.useContext(_t).id;return t&&e!==void 0?t+"-"+e:e}function Jo(e){function t(r,i={}){return Zo(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const es=["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 Yt(e){return typeof e!="string"||e.includes("-")?!1:!!(es.indexOf(e)>-1||/[A-Z]/.test(e))}const pt={};function ts(e){Object.assign(pt,e)}const _e=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ce=new Set(_e);function Xn(e,{layout:t,layoutId:n}){return Ce.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!pt[e]||e==="opacity")}const ee=e=>!!(e&&e.getVelocity),ns={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},rs=_e.length;function is(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let s="";for(let o=0;o<rs;o++){const a=_e[o];if(e[a]!==void 0){const l=ns[a]||a;s+=`${l}(${e[a]}) `}}return t&&!e.z&&(s+="translateZ(0)"),s=s.trim(),i?s=i(e,r?"":s):n&&r&&(s="none"),s}const Zn=e=>t=>typeof t=="string"&&t.startsWith(e),Qn=Zn("--"),Ht=Zn("var(--"),os=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,ss=(e,t)=>t&&typeof e=="number"?t.transform(e):e,me=(e,t,n)=>Math.min(Math.max(n,e),t),Se={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ye={...Se,transform:e=>me(0,1,e)},gt={...Se,default:1},He=e=>Math.round(e*1e5)/1e5,vt=/(-)?([\d]*\.?[\d])+/g,Jn=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,as=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function qe(e){return typeof e=="string"}const Ke=e=>({test:t=>qe(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),pe=Ke("deg"),le=Ke("%"),T=Ke("px"),ls=Ke("vh"),us=Ke("vw"),er={...le,parse:e=>le.parse(e)/100,transform:e=>le.transform(e*100)},tr={...Se,transform:Math.round},nr={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,radius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,size:T,top:T,right:T,bottom:T,left:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,rotate:pe,rotateX:pe,rotateY:pe,rotateZ:pe,scale:gt,scaleX:gt,scaleY:gt,scaleZ:gt,skew:pe,skewX:pe,skewY:pe,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:Ye,originX:er,originY:er,originZ:T,zIndex:tr,fillOpacity:Ye,strokeOpacity:Ye,numOctaves:tr};function qt(e,t,n,r){const{style:i,vars:s,transform:o,transformOrigin:a}=e;let l=!1,u=!1,c=!0;for(const d in t){const f=t[d];if(Qn(d)){s[d]=f;continue}const h=nr[d],m=ss(f,h);if(Ce.has(d)){if(l=!0,o[d]=m,!c)continue;f!==(h.default||0)&&(c=!1)}else d.startsWith("origin")?(u=!0,a[d]=m):i[d]=m}if(t.transform||(l||r?i.transform=is(e.transform,n,c,r):i.transform&&(i.transform="none")),u){const{originX:d="50%",originY:f="50%",originZ:h=0}=a;i.transformOrigin=`${d} ${f} ${h}`}}const Kt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rr(e,t,n){for(const r in t)!ee(t[r])&&!Xn(r,n)&&(e[r]=t[r])}function cs({transformTemplate:e},t,n){return g.useMemo(()=>{const r=Kt();return qt(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function ds(e,t,n){const r=e.style||{},i={};return rr(i,r,e),Object.assign(i,cs(e,t,n)),e.transformValues?e.transformValues(i):i}function fs(e,t,n){const r={},i=ds(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}const hs=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function yt(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||hs.has(e)}let ir=e=>!yt(e);function ms(e){e&&(ir=t=>t.startsWith("on")?!yt(t):e(t))}try{ms(require("@emotion/is-prop-valid").default)}catch{}function ps(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(ir(i)||n===!0&&yt(i)||!t&&!yt(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function or(e,t,n){return typeof e=="string"?e:T.transform(t+n*e)}function gs(e,t,n){const r=or(t,e.x,e.width),i=or(n,e.y,e.height);return`${r} ${i}`}const vs={offset:"stroke-dashoffset",array:"stroke-dasharray"},ys={offset:"strokeDashoffset",array:"strokeDasharray"};function bs(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?vs:ys;e[s.offset]=T.transform(-r);const o=T.transform(t),a=T.transform(n);e[s.array]=`${o} ${a}`}function Xt(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,d,f){if(qt(e,u,c,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:p}=e;h.transform&&(p&&(m.transform=h.transform),delete h.transform),p&&(i!==void 0||s!==void 0||m.transform)&&(m.transformOrigin=gs(p,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&bs(h,o,a,l,!1)}const sr=()=>({...Kt(),attrs:{}}),Zt=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ws(e,t,n,r){const i=g.useMemo(()=>{const s=sr();return Xt(s,t,{enableHardwareAcceleration:!1},Zt(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};rr(s,e.style,e),i.style={...s,...i.style}}return i}function xs(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Yt(n)?ws:fs)(r,s,o,n),c={...ps(r,typeof n=="string",e),...l,ref:i},{children:d}=r,f=g.useMemo(()=>ee(d)?d.get():d,[d]);return g.createElement(n,{...c,children:f})}}function ar(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const lr=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 ur(e,t,n,r){ar(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(lr.has(i)?i:$t(i),t.attrs[i])}function Qt(e,t){const{style:n}=e,r={};for(const i in n)(ee(n[i])||t.style&&ee(t.style[i])||Xn(i,e))&&(r[i]=n[i]);return r}function cr(e,t){const n=Qt(e,t);for(const r in e)if(ee(e[r])||ee(t[r])){const i=_e.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[i]=e[r]}return n}function Jt(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}function dr(e){const t=g.useRef(null);return t.current===null&&(t.current=e()),t.current}const bt=e=>Array.isArray(e),Ts=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),Ps=e=>bt(e)?e[e.length-1]||0:e;function wt(e){const t=ee(e)?e.get():e;return Ts(t)?t.toValue():t}function Cs({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,s){const o={latestValues:Ss(r,i,s,e),renderState:t()};return n&&(o.mount=a=>n(r,a,o)),o}const fr=e=>(t,n)=>{const r=g.useContext(ct),i=g.useContext(dt),s=()=>Cs(e,t,r,i);return n?s():dr(s)};function Ss(e,t,n,r){const i={},s=r(e,{});for(const f in s)i[f]=wt(s[f]);let{initial:o,animate:a}=e;const l=mt(e),u=Yn(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const d=c?a:o;return d&&typeof d!="boolean"&&!ht(d)&&(Array.isArray(d)?d:[d]).forEach(h=>{const m=Jt(e,h);if(!m)return;const{transitionEnd:p,transition:b,...w}=m;for(const y in w){let v=w[y];if(Array.isArray(v)){const x=c?v.length-1:0;v=v[x]}v!==null&&(i[y]=v)}for(const y in p)i[y]=p[y]}),i}const $=e=>e;class hr{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const n=this.order.indexOf(t);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}function Ms(e){let t=new hr,n=new hr,r=0,i=!1,s=!1;const o=new WeakSet,a={schedule:(l,u=!1,c=!1)=>{const d=c&&i,f=d?t:n;return u&&o.add(l),f.add(l)&&d&&i&&(r=t.order.length),l},cancel:l=>{n.remove(l),o.delete(l)},process:l=>{if(i){s=!0;return}if(i=!0,[t,n]=[n,t],n.clear(),r=t.order.length,r)for(let u=0;u<r;u++){const c=t.order[u];c(l),o.has(c)&&(a.schedule(c),e())}i=!1,s&&(s=!1,a.process(l))}};return a}const xt=["prepare","read","update","preRender","render","postRender"],Ds=40;function As(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=xt.reduce((d,f)=>(d[f]=Ms(()=>n=!0),d),{}),o=d=>s[d].process(i),a=()=>{const d=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(d-i.timestamp,Ds),1),i.timestamp=d,i.isProcessing=!0,xt.forEach(o),i.isProcessing=!1,n&&t&&(r=!1,e(a))},l=()=>{n=!0,r=!0,i.isProcessing||e(a)};return{schedule:xt.reduce((d,f)=>{const h=s[f];return d[f]=(m,p=!1,b=!1)=>(n||l(),h.schedule(m,p,b)),d},{}),cancel:d=>xt.forEach(f=>s[f].cancel(d)),state:i,steps:s}}const{schedule:j,cancel:ce,state:q,steps:en}=As(typeof requestAnimationFrame<"u"?requestAnimationFrame:$,!0),Vs={useVisualState:fr({scrapeMotionValuesFromProps:cr,createRenderState:sr,onMount:(e,t,{renderState:n,latestValues:r})=>{j.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),j.render(()=>{Xt(n,r,{enableHardwareAcceleration:!1},Zt(t.tagName),e.transformTemplate),ur(t,n)})}})},ks={useVisualState:fr({scrapeMotionValuesFromProps:Qt,createRenderState:Kt})};function Es(e,{forwardMotionProps:t=!1},n,r){return{...Yt(e)?Vs:ks,preloadedFeatures:n,useRender:xs(t),createVisualElement:r,Component:e}}function de(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const mr=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Tt(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const Os=e=>t=>mr(t)&&e(t,Tt(t));function fe(e,t,n,r){return de(e,t,Os(n),r)}const Ls=(e,t)=>n=>t(e(n)),ge=(...e)=>e.reduce(Ls);function pr(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const gr=pr("dragHorizontal"),vr=pr("dragVertical");function yr(e){let t=!1;if(e==="y")t=vr();else if(e==="x")t=gr();else{const n=gr(),r=vr();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function br(){const e=yr(!0);return e?(e(),!1):!0}class ve{constructor(t){this.isMounted=!1,this.node=t}update(){}}function wr(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),i=(s,o)=>{if(s.pointerType==="touch"||br())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[r]&&j.update(()=>a[r](s,o))};return fe(e.current,n,i,{passive:!e.getProps()[r]})}class Is extends ve{mount(){this.unmount=ge(wr(this.node,!0),wr(this.node,!1))}unmount(){}}class Fs extends ve{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ge(de(this.node.current,"focus",()=>this.onFocus()),de(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const xr=(e,t)=>t?e===t?!0:xr(e,t.parentElement):!1;function tn(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Tt(n))}class Bs extends ve{constructor(){super(...arguments),this.removeStartListeners=$,this.removeEndListeners=$,this.removeAccessibleListeners=$,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),s=fe(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:d}=this.node.getProps();j.update(()=>{!d&&!xr(this.node.current,a.target)?c&&c(a,l):u&&u(a,l)})},{passive:!(r.onTap||r.onPointerUp)}),o=fe(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=ge(s,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||tn("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&j.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=de(this.node.current,"keyup",o),tn("down",(a,l)=>{this.startPress(a,l)})},n=de(this.node.current,"keydown",t),r=()=>{this.isPressing&&tn("cancel",(s,o)=>this.cancelPress(s,o))},i=de(this.node.current,"blur",r);this.removeAccessibleListeners=ge(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&j.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!br()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&j.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=fe(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=de(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=ge(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const nn=new WeakMap,rn=new WeakMap,js=e=>{const t=nn.get(e.target);t&&t(e)},Ns=e=>{e.forEach(js)};function Us({root:e,...t}){const n=e||document;rn.has(n)||rn.set(n,{});const r=rn.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Ns,{root:e,...t})),r[i]}function Ws(e,t,n){const r=Us(t);return nn.set(e,n),r.observe(e),()=>{nn.delete(e),r.unobserve(e)}}const Rs={some:0,all:1};class $s extends ve{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Rs[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return Ws(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(zs(t,n))&&this.startObserver()}unmount(){}}function zs({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Gs={inView:{Feature:$s},tap:{Feature:Bs},focus:{Feature:Fs},hover:{Feature:Is}};function Tr(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function _s(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function Ys(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function Pt(e,t,n){const r=e.getProps();return Jt(r,t,n!==void 0?n:r.custom,_s(e),Ys(e))}let Xe=$,ne=$;process.env.NODE_ENV!=="production"&&(Xe=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},ne=(e,t)=>{if(!e)throw new Error(t)});const ye=e=>e*1e3,he=e=>e/1e3,Hs={current:!1},Pr=e=>Array.isArray(e)&&typeof e[0]=="number";function Cr(e){return!!(!e||typeof e=="string"&&Sr[e]||Pr(e)||Array.isArray(e)&&e.every(Cr))}const Ze=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Sr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ze([0,.65,.55,1]),circOut:Ze([.55,0,1,.45]),backIn:Ze([.31,.01,.66,-.59]),backOut:Ze([.33,1.53,.69,.99])};function Mr(e){if(e)return Pr(e)?Ze(e):Array.isArray(e)?e.map(Mr):Sr[e]}function qs(e,t,n,{delay:r=0,duration:i,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=Mr(a);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}function Ks(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const Dr=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Xs=1e-7,Zs=12;function Qs(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=Dr(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>Xs&&++a<Zs);return o}function Qe(e,t,n,r){if(e===t&&n===r)return $;const i=s=>Qs(s,0,1,e,n);return s=>s===0||s===1?s:Dr(i(s),t,r)}const Js=Qe(.42,0,1,1),ea=Qe(0,0,.58,1),Ar=Qe(.42,0,.58,1),ta=e=>Array.isArray(e)&&typeof e[0]!="number",Vr=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,kr=e=>t=>1-e(1-t),on=e=>1-Math.sin(Math.acos(e)),Er=kr(on),na=Vr(on),Or=Qe(.33,1.53,.69,.99),sn=kr(Or),ra=Vr(sn),Lr={linear:$,easeIn:Js,easeInOut:Ar,easeOut:ea,circIn:on,circInOut:na,circOut:Er,backIn:sn,backInOut:ra,backOut:Or,anticipate:e=>(e*=2)<1?.5*sn(e):.5*(2-Math.pow(2,-10*(e-1)))},Ir=e=>{if(Array.isArray(e)){ne(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,i]=e;return Qe(t,n,r,i)}else if(typeof e=="string")return ne(Lr[e]!==void 0,`Invalid easing type '${e}'`),Lr[e];return e},an=(e,t)=>n=>!!(qe(n)&&as.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),Fr=(e,t,n)=>r=>{if(!qe(r))return r;const[i,s,o,a]=r.match(vt);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},ia=e=>me(0,255,e),ln={...Se,transform:e=>Math.round(ia(e))},Me={test:an("rgb","red"),parse:Fr("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+ln.transform(e)+", "+ln.transform(t)+", "+ln.transform(n)+", "+He(Ye.transform(r))+")"};function oa(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const un={test:an("#"),parse:oa,transform:Me.transform},je={test:an("hsl","hue"),parse:Fr("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+le.transform(He(t))+", "+le.transform(He(n))+", "+He(Ye.transform(r))+")"},Q={test:e=>Me.test(e)||un.test(e)||je.test(e),parse:e=>Me.test(e)?Me.parse(e):je.test(e)?je.parse(e):un.parse(e),transform:e=>qe(e)?e:e.hasOwnProperty("red")?Me.transform(e):je.transform(e)},W=(e,t,n)=>-n*e+n*t+e;function cn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function sa({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=cn(l,a,e+1/3),s=cn(l,a,e),o=cn(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}const dn=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},aa=[un,Me,je],la=e=>aa.find(t=>t.test(e));function Br(e){const t=la(e);ne(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`);let n=t.parse(e);return t===je&&(n=sa(n)),n}const jr=(e,t)=>{const n=Br(e),r=Br(t),i={...n};return s=>(i.red=dn(n.red,r.red,s),i.green=dn(n.green,r.green,s),i.blue=dn(n.blue,r.blue,s),i.alpha=W(n.alpha,r.alpha,s),Me.transform(i))};function ua(e){var t,n;return isNaN(e)&&qe(e)&&(((t=e.match(vt))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Jn))===null||n===void 0?void 0:n.length)||0)>0}const Nr={regex:os,countKey:"Vars",token:"${v}",parse:$},Ur={regex:Jn,countKey:"Colors",token:"${c}",parse:Q.parse},Wr={regex:vt,countKey:"Numbers",token:"${n}",parse:Se.parse};function fn(e,{regex:t,countKey:n,token:r,parse:i}){const s=e.tokenised.match(t);s&&(e["num"+n]=s.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...s.map(i)))}function Ct(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&fn(n,Nr),fn(n,Ur),fn(n,Wr),n}function Rr(e){return Ct(e).values}function $r(e){const{values:t,numColors:n,numVars:r,tokenised:i}=Ct(e),s=t.length;return o=>{let a=i;for(let l=0;l<s;l++)l<r?a=a.replace(Nr.token,o[l]):l<r+n?a=a.replace(Ur.token,Q.transform(o[l])):a=a.replace(Wr.token,He(o[l]));return a}}const ca=e=>typeof e=="number"?0:e;function da(e){const t=Rr(e);return $r(e)(t.map(ca))}const be={test:ua,parse:Rr,createTransformer:$r,getAnimatableNone:da},zr=(e,t)=>n=>`${n>0?t:e}`;function Gr(e,t){return typeof e=="number"?n=>W(e,t,n):Q.test(e)?jr(e,t):e.startsWith("var(")?zr(e,t):Yr(e,t)}const _r=(e,t)=>{const n=[...e],r=n.length,i=e.map((s,o)=>Gr(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}},fa=(e,t)=>{const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Gr(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}},Yr=(e,t)=>{const n=be.createTransformer(t),r=Ct(e),i=Ct(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?ge(_r(r.values,i.values),n):(Xe(!0,`Complex values '${e}' and '${t}' 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.`),zr(e,t))},Je=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Hr=(e,t)=>n=>W(e,t,n);function ha(e){return typeof e=="number"?Hr:typeof e=="string"?Q.test(e)?jr:Yr:Array.isArray(e)?_r:typeof e=="object"?fa:Hr}function ma(e,t,n){const r=[],i=n||ha(e[0]),s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||$:t;a=ge(l,a)}r.push(a)}return r}function qr(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(ne(s===t.length,"Both input and output ranges must be the same length"),s===1)return()=>t[0];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=ma(t,r,i),a=o.length,l=u=>{let c=0;if(a>1)for(;c<e.length-2&&!(u<e[c+1]);c++);const d=Je(e[c],e[c+1],u);return o[c](d)};return n?u=>l(me(e[0],e[s-1],u)):l}function pa(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Je(0,t,r);e.push(W(n,1,i))}}function ga(e){const t=[0];return pa(t,e.length-1),t}function va(e,t){return e.map(n=>n*t)}function ya(e,t){return e.map(()=>t||Ar).splice(0,e.length-1)}function St({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=ta(r)?r.map(Ir):Ir(r),s={done:!1,value:t[0]},o=va(n&&n.length===t.length?n:ga(t),e),a=qr(o,t,{ease:Array.isArray(i)?i:ya(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}function Kr(e,t){return t?e*(1e3/t):0}const ba=5;function Xr(e,t,n){const r=Math.max(t-ba,0);return Kr(n-e(r),t-r)}const hn=.001,wa=.01,Zr=10,xa=.05,Ta=1;function Pa({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,s;Xe(e<=ye(Zr),"Spring duration must be 10 seconds or less");let o=1-t;o=me(xa,Ta,o),e=me(wa,Zr,he(e)),o<1?(i=u=>{const c=u*o,d=c*e,f=c-n,h=mn(u,o),m=Math.exp(-d);return hn-f/h*m},s=u=>{const d=u*o*e,f=d*n+n,h=Math.pow(o,2)*Math.pow(u,2)*e,m=Math.exp(-d),p=mn(Math.pow(u,2),o);return(-i(u)+hn>0?-1:1)*((f-h)*m)/p}):(i=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-hn+c*d},s=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const a=5/e,l=Sa(i,s,a);if(e=ye(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const Ca=12;function Sa(e,t,n){let r=n;for(let i=1;i<Ca;i++)r=r-e(r)/t(r);return r}function mn(e,t){return e*Math.sqrt(1-t*t)}const Ma=["duration","bounce"],Da=["stiffness","damping","mass"];function Qr(e,t){return t.some(n=>e[n]!==void 0)}function Aa(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Qr(e,Da)&&Qr(e,Ma)){const n=Pa(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function Jr({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],s=e[e.length-1],o={done:!1,value:i},{stiffness:a,damping:l,mass:u,duration:c,velocity:d,isResolvedFromDuration:f}=Aa({...r,velocity:-he(r.velocity||0)}),h=d||0,m=l/(2*Math.sqrt(a*u)),p=s-i,b=he(Math.sqrt(a/u)),w=Math.abs(p)<5;n||(n=w?.01:2),t||(t=w?.005:.5);let y;if(m<1){const v=mn(b,m);y=x=>{const S=Math.exp(-m*b*x);return s-S*((h+m*b*p)/v*Math.sin(v*x)+p*Math.cos(v*x))}}else if(m===1)y=v=>s-Math.exp(-b*v)*(p+(h+b*p)*v);else{const v=b*Math.sqrt(m*m-1);y=x=>{const S=Math.exp(-m*b*x),O=Math.min(v*x,300);return s-S*((h+m*b*p)*Math.sinh(O)+v*p*Math.cosh(O))/v}}return{calculatedDuration:f&&c||null,next:v=>{const x=y(v);if(f)o.done=v>=c;else{let S=h;v!==0&&(m<1?S=Xr(y,v,x):S=0);const O=Math.abs(S)<=n,k=Math.abs(s-x)<=t;o.done=O&&k}return o.value=o.done?s:x,o}}}function ei({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},h=P=>a!==void 0&&P<a||l!==void 0&&P>l,m=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let p=n*t;const b=d+p,w=o===void 0?b:o(b);w!==b&&(p=w-d);const y=P=>-p*Math.exp(-P/r),v=P=>w+y(P),x=P=>{const M=y(P),U=v(P);f.done=Math.abs(M)<=u,f.value=f.done?w:U};let S,O;const k=P=>{h(f.value)&&(S=P,O=Jr({keyframes:[f.value,m(f.value)],velocity:Xr(v,P,f.value),damping:i,stiffness:s,restDelta:u,restSpeed:c}))};return k(0),{calculatedDuration:null,next:P=>{let M=!1;return!O&&S===void 0&&(M=!0,x(P),k(P)),S!==void 0&&P>S?O.next(P-S):(!M&&x(P),f)}}}const Va=e=>{const t=({timestamp:n})=>e(n);return{start:()=>j.update(t,!0),stop:()=>ce(t),now:()=>q.isProcessing?q.timestamp:performance.now()}},ti=2e4;function ni(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<ti;)t+=n,r=e.next(t);return t>=ti?1/0:t}const ka={decay:ei,inertia:ei,tween:St,keyframes:St,spring:Jr};function Mt({autoplay:e=!0,delay:t=0,driver:n=Va,keyframes:r,type:i="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:d,...f}){let h=1,m=!1,p,b;const w=()=>{b=new Promise(I=>{p=I})};w();let y;const v=ka[i]||St;let x;v!==St&&typeof r[0]!="number"&&(process.env.NODE_ENV!=="production"&&ne(r.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${r}`),x=qr([0,100],r,{clamp:!1}),r=[0,100]);const S=v({...f,keyframes:r});let O;a==="mirror"&&(O=v({...f,keyframes:[...r].reverse(),velocity:-(f.velocity||0)}));let k="idle",P=null,M=null,U=null;S.calculatedDuration===null&&s&&(S.calculatedDuration=ni(S));const{calculatedDuration:J}=S;let A=1/0,_=1/0;J!==null&&(A=J+o,_=A*(s+1)-o);let V=0;const C=I=>{if(M===null)return;h>0&&(M=Math.min(M,I)),h<0&&(M=Math.min(I-_/h,M)),P!==null?V=P:V=Math.round(I-M)*h;const se=V-t*(h>=0?1:-1),X=h>=0?se<0:se>_;V=Math.max(se,0),k==="finished"&&P===null&&(V=_);let Ro=V,$o=S;if(s){const $n=Math.min(V,_)/A;let Wt=Math.floor($n),Fe=$n%1;!Fe&&$n>=1&&(Fe=1),Fe===1&&Wt--,Wt=Math.min(Wt,s+1),!!(Wt%2)&&(a==="reverse"?(Fe=1-Fe,o&&(Fe-=o/A)):a==="mirror"&&($o=O)),Ro=me(0,1,Fe)*A}const ut=X?{done:!1,value:r[0]}:$o.next(Ro);x&&(ut.value=x(ut.value));let{done:zo}=ut;!X&&J!==null&&(zo=h>=0?V>=_:V<=0);const Df=P===null&&(k==="finished"||k==="running"&&zo);return d&&d(ut.value),Df&&Y(),ut},D=()=>{y&&y.stop(),y=void 0},B=()=>{k="idle",D(),p(),w(),M=U=null},Y=()=>{k="finished",c&&c(),D(),p()},R=()=>{if(m)return;y||(y=n(C));const I=y.now();l&&l(),P!==null?M=I-P:(!M||k==="finished")&&(M=I),k==="finished"&&w(),U=M,P=null,k="running",y.start()};e&&R();const G={then(I,se){return b.then(I,se)},get time(){return he(V)},set time(I){I=ye(I),V=I,P!==null||!y||h===0?P=I:M=y.now()-I/h},get duration(){const I=S.calculatedDuration===null?ni(S):S.calculatedDuration;return he(I)},get speed(){return h},set speed(I){I===h||!y||(h=I,G.time=he(V))},get state(){return k},play:R,pause:()=>{k="paused",P=V},stop:()=>{m=!0,k!=="idle"&&(k="idle",u&&u(),B())},cancel:()=>{U!==null&&C(U),B()},complete:()=>{k="finished"},sample:I=>(M=0,C(I))};return G}function Ea(e){let t;return()=>(t===void 0&&(t=e()),t)}const Oa=Ea(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),La=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Dt=10,Ia=2e4,Fa=(e,t)=>t.type==="spring"||e==="backgroundColor"||!Cr(t.ease);function Ba(e,t,{onUpdate:n,onComplete:r,...i}){if(!(Oa()&&La.has(t)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0&&i.type!=="inertia"))return!1;let o=!1,a,l,u=!1;const c=()=>{l=new Promise(v=>{a=v})};c();let{keyframes:d,duration:f=300,ease:h,times:m}=i;if(Fa(t,i)){const v=Mt({...i,repeat:0,delay:0});let x={done:!1,value:d[0]};const S=[];let O=0;for(;!x.done&&O<Ia;)x=v.sample(O),S.push(x.value),O+=Dt;m=void 0,d=S,f=O-Dt,h="linear"}const p=qs(e.owner.current,t,d,{...i,duration:f,ease:h,times:m}),b=()=>{u=!1,p.cancel()},w=()=>{u=!0,j.update(b),a(),c()};return p.onfinish=()=>{u||(e.set(Ks(d,i)),r&&r(),w())},{then(v,x){return l.then(v,x)},attachTimeline(v){return p.timeline=v,p.onfinish=null,$},get time(){return he(p.currentTime||0)},set time(v){p.currentTime=ye(v)},get speed(){return p.playbackRate},set speed(v){p.playbackRate=v},get duration(){return he(f)},play:()=>{o||(p.play(),ce(b))},pause:()=>p.pause(),stop:()=>{if(o=!0,p.playState==="idle")return;const{currentTime:v}=p;if(v){const x=Mt({...i,autoplay:!1});e.setWithVelocity(x.sample(v-Dt).value,x.sample(v).value,Dt)}w()},complete:()=>{u||p.finish()},cancel:w}}function ja({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const i=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:$,pause:$,stop:$,then:s=>(s(),Promise.resolve()),cancel:$,complete:$});return t?Mt({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}const Na={type:"spring",stiffness:500,damping:25,restSpeed:10},Ua=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Wa={type:"keyframes",duration:.8},Ra={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$a=(e,{keyframes:t})=>t.length>2?Wa:Ce.has(e)?e.startsWith("scale")?Ua(t[1]):Na:Ra,pn=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(be.test(t)||t==="0")&&!t.startsWith("url(")),za=new Set(["brightness","contrast","saturate","opacity"]);function Ga(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(vt)||[];if(!r)return e;const i=n.replace(r,"");let s=za.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const _a=/([a-z-]*)\(.*?\)/g,gn={...be,getAnimatableNone:e=>{const t=e.match(_a);return t?t.map(Ga).join(" "):e}},Ya={...nr,color:Q,backgroundColor:Q,outlineColor:Q,fill:Q,stroke:Q,borderColor:Q,borderTopColor:Q,borderRightColor:Q,borderBottomColor:Q,borderLeftColor:Q,filter:gn,WebkitFilter:gn},vn=e=>Ya[e];function ri(e,t){let n=vn(e);return n!==gn&&(n=be),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const ii=e=>/^0[^.\s]+$/.test(e);function Ha(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||ii(e)}function qa(e,t,n,r){const i=pn(t,n);let s;Array.isArray(n)?s=[...n]:s=[null,n];const o=r.from!==void 0?r.from:e.get();let a;const l=[];for(let u=0;u<s.length;u++)s[u]===null&&(s[u]=u===0?o:s[u-1]),Ha(s[u])&&l.push(u),typeof s[u]=="string"&&s[u]!=="none"&&s[u]!=="0"&&(a=s[u]);if(i&&l.length&&a)for(let u=0;u<l.length;u++){const c=l[u];s[c]=ri(t,a)}return s}function Ka({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}function yn(e,t){return e[t]||e.default||e}const Xa={skipAnimations:!1},bn=(e,t,n,r={})=>i=>{const s=yn(r,e)||{},o=s.delay||r.delay||0;let{elapsed:a=0}=r;a=a-ye(o);const l=qa(t,e,n,s),u=l[0],c=l[l.length-1],d=pn(e,u),f=pn(e,c);Xe(d===f,`You are trying to animate ${e} from "${u}" to "${c}". ${u} is not an animatable value - to enable this animation set ${u} to a value animatable to ${c} via the \`style\` property.`);let h={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...s,delay:-a,onUpdate:m=>{t.set(m),s.onUpdate&&s.onUpdate(m)},onComplete:()=>{i(),s.onComplete&&s.onComplete()}};if(Ka(s)||(h={...h,...$a(e,h)}),h.duration&&(h.duration=ye(h.duration)),h.repeatDelay&&(h.repeatDelay=ye(h.repeatDelay)),!d||!f||Hs.current||s.type===!1||Xa.skipAnimations)return ja(h);if(!r.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const m=Ba(t,e,h);if(m)return m}return Mt(h)};function At(e){return!!(ee(e)&&e.add)}const oi=e=>/^\-?\d*\.?\d+$/.test(e);function wn(e,t){e.indexOf(t)===-1&&e.push(t)}function xn(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Tn{constructor(){this.subscriptions=[]}add(t){return wn(this.subscriptions,t),()=>xn(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const si=new Set;function Pn(e,t,n){e||si.has(t)||(console.warn(t),n&&console.warn(n),si.add(t))}const Za=e=>!isNaN(parseFloat(e));class Qa{constructor(t,n={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,i=!0)=>{this.prev=this.current,this.current=r;const{delta:s,timestamp:o}=q;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,j.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>j.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=Za(this.current),this.owner=n.owner}onChange(t){return process.env.NODE_ENV!=="production"&&Pn(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Tn);const r=this.events[t].add(n);return t==="change"?()=>{r(),j.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Kr(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ne(e,t){return new Qa(e,t)}const ai=e=>t=>t.test(e),li=[Se,T,le,pe,us,ls,{test:e=>e==="auto",parse:e=>e}],et=e=>li.find(ai(e)),Ja=[...li,Q,be],el=e=>Ja.find(ai(e));function tl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ne(n))}function nl(e,t){const n=Pt(e,t);let{transitionEnd:r={},transition:i={},...s}=n?e.makeTargetAnimatable(n,!1):{};s={...s,...r};for(const o in s){const a=Ps(s[o]);tl(e,o,a)}}function rl(e,t,n){var r,i;const s=Object.keys(t).filter(a=>!e.hasValue(a)),o=s.length;if(o)for(let a=0;a<o;a++){const l=s[a],u=t[l];let c=null;Array.isArray(u)&&(c=u[0]),c===null&&(c=(i=(r=n[l])!==null&&r!==void 0?r:e.readValue(l))!==null&&i!==void 0?i:t[l]),c!=null&&(typeof c=="string"&&(oi(c)||ii(c))?c=parseFloat(c):!el(c)&&be.test(u)&&(c=ri(l,u)),e.addValue(l,Ne(c,{owner:e})),n[l]===void 0&&(n[l]=c),c!==null&&e.setBaseTarget(l,c))}}function il(e,t){return t?(t[e]||t.default||t).from:void 0}function ol(e,t,n){const r={};for(const i in e){const s=il(i,t);if(s!==void 0)r[i]=s;else{const o=n.getValue(i);o&&(r[i]=o.get())}}return r}function sl({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function al(e,t){const n=e.get();if(Array.isArray(t)){for(let r=0;r<t.length;r++)if(t[r]!==n)return!0}else return n!==t}function ui(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:o,...a}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");r&&(s=r);const u=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in a){const f=e.getValue(d),h=a[d];if(!f||h===void 0||c&&sl(c,d))continue;const m={delay:n,elapsed:0,...yn(s||{},d)};if(window.HandoffAppearAnimations){const w=e.getProps()[_n];if(w){const y=window.HandoffAppearAnimations(w,d,f,j);y!==null&&(m.elapsed=y,m.isHandoff=!0)}}let p=!m.isHandoff&&!al(f,h);if(m.type==="spring"&&(f.getVelocity()||m.velocity)&&(p=!1),f.animation&&(p=!1),p)continue;f.start(bn(d,f,h,e.shouldReduceMotion&&Ce.has(d)?{type:!1}:m));const b=f.animation;At(l)&&(l.add(d),b.then(()=>l.remove(d))),u.push(b)}return o&&Promise.all(u).then(()=>{o&&nl(e,o)}),u}function Cn(e,t,n={}){const r=Pt(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(ui(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:d}=i;return ll(e,t,u+l,c,d,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,u]=a==="beforeChildren"?[s,o]:[o,s];return l().then(()=>u())}else return Promise.all([s(),o(n.delay)])}function ll(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(ul).forEach((u,c)=>{u.notify("AnimationStart",t),o.push(Cn(u,t,{...s,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function ul(e,t){return e.sortNodePosition(t)}function cl(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Cn(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Cn(e,t,n);else{const i=typeof t=="function"?Pt(e,t,n.custom):t;r=Promise.all(ui(e,i,n))}return r.then(()=>e.notify("AnimationComplete",t))}const dl=[...zt].reverse(),fl=zt.length;function hl(e){return t=>Promise.all(t.map(({animation:n,options:r})=>cl(e,n,r)))}function ml(e){let t=hl(e);const n=gl();let r=!0;const i=(l,u)=>{const c=Pt(e,u);if(c){const{transition:d,transitionEnd:f,...h}=c;l={...l,...h,...f}}return l};function s(l){t=l(e)}function o(l,u){const c=e.getProps(),d=e.getVariantContext(!0)||{},f=[],h=new Set;let m={},p=1/0;for(let w=0;w<fl;w++){const y=dl[w],v=n[y],x=c[y]!==void 0?c[y]:d[y],S=ze(x),O=y===u?v.isActive:null;O===!1&&(p=w);let k=x===d[y]&&x!==c[y]&&S;if(k&&r&&e.manuallyAnimateOnMount&&(k=!1),v.protectedKeys={...m},!v.isActive&&O===null||!x&&!v.prevProp||ht(x)||typeof x=="boolean")continue;let M=pl(v.prevProp,x)||y===u&&v.isActive&&!k&&S||w>p&&S,U=!1;const J=Array.isArray(x)?x:[x];let A=J.reduce(i,{});O===!1&&(A={});const{prevResolvedValues:_={}}=v,V={..._,...A},C=D=>{M=!0,h.has(D)&&(U=!0,h.delete(D)),v.needsAnimating[D]=!0};for(const D in V){const B=A[D],Y=_[D];if(m.hasOwnProperty(D))continue;let R=!1;bt(B)&&bt(Y)?R=!Tr(B,Y):R=B!==Y,R?B!==void 0?C(D):h.add(D):B!==void 0&&h.has(D)?C(D):v.protectedKeys[D]=!0}v.prevProp=x,v.prevResolvedValues=A,v.isActive&&(m={...m,...A}),r&&e.blockInitialAnimation&&(M=!1),M&&(!k||U)&&f.push(...J.map(D=>({animation:D,options:{type:y,...l}})))}if(h.size){const w={};h.forEach(y=>{const v=e.getBaseTarget(y);v!==void 0&&(w[y]=v)}),f.push({animation:w})}let b=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(b=!1),r=!1,b?t(f):Promise.resolve()}function a(l,u,c){var d;if(n[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(l,u)}),n[l].isActive=u;const f=o(c,l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n}}function pl(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Tr(t,e):!1}function De(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function gl(){return{animate:De(!0),whileInView:De(),whileHover:De(),whileTap:De(),whileDrag:De(),whileFocus:De(),exit:De()}}class vl extends ve{constructor(t){super(t),t.animationState||(t.animationState=ml(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),ht(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let yl=0;class bl extends ve{constructor(){super(...arguments),this.id=yl++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const s=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const wl={animation:{Feature:vl},exit:{Feature:bl}},ci=(e,t)=>Math.abs(e-t);function xl(e,t){const n=ci(e.x,t.x),r=ci(e.y,t.y);return Math.sqrt(n**2+r**2)}class di{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Mn(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=xl(d.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=d,{timestamp:p}=q;this.history.push({...m,timestamp:p});const{onStart:b,onMove:w}=this.handlers;f||(b&&b(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Sn(f,this.transformPagePoint),j.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:p}=this.handlers;if(this.dragSnapToOrigin&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Mn(d.type==="pointercancel"?this.lastMoveEventInfo:Sn(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(d,b),m&&m(d,b)},!mr(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=Tt(t),a=Sn(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=q;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(t,Mn(a,this.history)),this.removeListeners=ge(fe(this.contextWindow,"pointermove",this.handlePointerMove),fe(this.contextWindow,"pointerup",this.handlePointerUp),fe(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ce(this.updatePoint)}}function Sn(e,t){return t?{point:t(e.point)}:e}function fi(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Mn({point:e},t){return{point:e,delta:fi(e,hi(t)),offset:fi(e,Tl(t)),velocity:Pl(t,.1)}}function Tl(e){return e[0]}function hi(e){return e[e.length-1]}function Pl(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=hi(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>ye(t)));)n--;if(!r)return{x:0,y:0};const s=he(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function te(e){return e.max-e.min}function Dn(e,t=0,n=.01){return Math.abs(e-t)<=n}function mi(e,t,n,r=.5){e.origin=r,e.originPoint=W(t.min,t.max,e.origin),e.scale=te(n)/te(t),(Dn(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=W(n.min,n.max,e.origin)-e.originPoint,(Dn(e.translate)||isNaN(e.translate))&&(e.translate=0)}function tt(e,t,n,r){mi(e.x,t.x,n.x,r?r.originX:void 0),mi(e.y,t.y,n.y,r?r.originY:void 0)}function pi(e,t,n){e.min=n.min+t.min,e.max=e.min+te(t)}function Cl(e,t,n){pi(e.x,t.x,n.x),pi(e.y,t.y,n.y)}function gi(e,t,n){e.min=t.min-n.min,e.max=e.min+te(t)}function nt(e,t,n){gi(e.x,t.x,n.x),gi(e.y,t.y,n.y)}function Sl(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?W(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?W(n,e,r.max):Math.min(e,n)),e}function vi(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Ml(e,{top:t,left:n,bottom:r,right:i}){return{x:vi(e.x,n,i),y:vi(e.y,t,r)}}function yi(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&