mydocsai
Version:
A production-ready, responsive AI chatbot component for React applications with streaming support, mobile optimization, and secure API key handling.
3 lines • 289 kB
JavaScript
import*as e from"react";import t,{createContext as n,useLayoutEffect as r,useEffect as o,useContext as i,useRef as s,useInsertionEffect as a,useCallback as l,useMemo as c,forwardRef as u,createElement as h,useId as d,useState as f,cloneElement as p,Children as m,isValidElement as g}from"react";import{jsxs as y,jsx as v,Fragment as x}from"react/jsx-runtime";function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function k(e,t,n,r,o,i,s){try{var a=e[i](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){k(i,r,o,s,a,"next",e)}function a(e){k(i,r,o,s,a,"throw",e)}s(void 0)}))}}function S(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},C.apply(null,arguments)}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function A(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof a?r:a,c=Object.create(l.prototype);return D(c,"_invoke",function(n,r,o){var i,a,l,c=0,u=o||[],h=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,a=0,l=e,d.n=n,s}};function f(n,r){for(a=n,l=r,t=0;!h&&c&&!o&&t<u.length;t++){var o,i=u[t],f=d.p,p=i[2];n>3?(o=p===r)&&(l=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(a=0,d.v=r,d.n=i[1]):f<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,d.n=p,a=0))}if(o||n>1)return s;throw h=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&f(u,p),a=u,l=p;(t=a<2?e:l)||!h;){i||(a?a<3?(a>1&&(d.n=-1),f(a,l)):d.n=l:d.v=l);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(h=d.n<0)?l:n.call(r,d))!==s)break}catch(t){i=e,a=1,l=t}finally{c=1}}return{value:t,done:h}}}(n,o,i),!0),c}var s={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(D(t={},r,(function(){return this})),t),h=c.prototype=a.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,D(e,o,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=c,D(h,"constructor",c),D(c,"constructor",l),l.displayName="GeneratorFunction",D(c,o,"GeneratorFunction"),D(h),D(h,o,"Generator"),D(h,r,(function(){return this})),D(h,"toString",(function(){return"[object Generator]"})),(A=function(){return{w:i,m:d}})()}function D(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}D=function(e,t,n,r){if(t)o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{function i(t,n){D(e,t,(function(e){return this._invoke(t,n,e)}))}i("next",0),i("throw",1),i("return",2)}},D(e,t,n,r)}function M(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function L(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||O(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||O(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,t){if(e){if("string"==typeof e)return b(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}const F=n({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),R=n({}),V=n(null),j="undefined"!=typeof document,N=j?r:o,B=n({strict:!1}),z=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),_="data-"+z("framerAppearId");function U(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function H(e){return"string"==typeof e||Array.isArray(e)}function W(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const $=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],q=["initial",...$];function Y(e){return W(e.animate)||q.some((t=>H(e[t])))}function X(e){return Boolean(Y(e)||e.variants)}function K(e){const{initial:t,animate:n}=function(e,t){if(Y(e)){const{initial:t,animate:n}=e;return{initial:!1===t||H(t)?t:void 0,animate:H(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,i(R));return c((()=>({initial:t,animate:n})),[G(t),G(n)])}function G(e){return Array.isArray(e)?e.join(" "):e}const Z={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"]},Q={};for(const e in Z)Q[e]={isEnabled:t=>Z[e].some((e=>!!t[e]))};const J=n({}),ee=n({}),te=Symbol.for("motionComponentSymbol");function ne({preloadedFeatures:t,createVisualElement:n,useRender:r,useVisualState:c,Component:h}){t&&function(e){for(const t in e)Q[t]={...Q[t],...e[t]}}(t);const d=u((function(u,d){let f;const p={...i(F),...u,layoutId:re(u)},{isStatic:m}=p,g=K(u),y=c(u,m);if(!m&&j){g.visualElement=function(e,t,n,r){const{visualElement:l}=i(R),c=i(B),u=i(V),h=i(F).reducedMotion,d=s();r=r||c.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:h}));const f=d.current;a((()=>{f&&f.update(n,u)}));const p=s(Boolean(n[_]&&!window.HandoffComplete));return N((()=>{f&&(f.render(),p.current&&f.animationState&&f.animationState.animateChanges())})),o((()=>{f&&(f.updateFeatures(),!p.current&&f.animationState&&f.animationState.animateChanges(),p.current&&(p.current=!1,window.HandoffComplete=!0))})),f}(h,y,p,n);const e=i(ee),r=i(B).strict;g.visualElement&&(f=g.visualElement.loadFeatures(p,r,t,e))}return e.createElement(R.Provider,{value:g},f&&g.visualElement?e.createElement(f,{visualElement:g.visualElement,...p}):null,r(h,u,function(e,t,n){return l((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):U(n)&&(n.current=r))}),[t])}(y,g.visualElement,d),y,m,g.visualElement))}));return d[te]=h,d}function re({layoutId:e}){const t=i(J).id;return t&&void 0!==e?t+"-"+e:e}function oe(e){function t(t,n={}){return ne(e(t,n))}if("undefined"==typeof Proxy)return t;const n=new Map;return new Proxy(t,{get:(e,r)=>(n.has(r)||n.set(r,t(r)),n.get(r))})}const ie=["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 se(e){return"string"==typeof e&&!e.includes("-")&&!!(ie.indexOf(e)>-1||/[A-Z]/.test(e))}const ae={};const le=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ce=new Set(le);function ue(e,{layout:t,layoutId:n}){return ce.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!ae[e]||"opacity"===e)}const he=e=>Boolean(e&&e.getVelocity),de={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},fe=le.length;const pe=e=>t=>"string"==typeof t&&t.startsWith(e),me=pe("--"),ge=pe("var(--"),ye=(e,t)=>t&&"number"==typeof e?t.transform(e):e,ve=(e,t,n)=>Math.min(Math.max(n,e),t),xe={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},be={...xe,transform:e=>ve(0,1,e)},ke={...xe,default:1},we=e=>Math.round(1e5*e)/1e5,Se=/(-)?([\d]*\.?[\d])+/g,Ce=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Ee=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Pe(e){return"string"==typeof e}const Te=e=>({test:t=>Pe(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Ae=Te("deg"),De=Te("%"),Me=Te("px"),Le=Te("vh"),Ie=Te("vw"),Oe={...De,parse:e=>De.parse(e)/100,transform:e=>De.transform(100*e)},Fe={...xe,transform:Math.round},Re={borderWidth:Me,borderTopWidth:Me,borderRightWidth:Me,borderBottomWidth:Me,borderLeftWidth:Me,borderRadius:Me,radius:Me,borderTopLeftRadius:Me,borderTopRightRadius:Me,borderBottomRightRadius:Me,borderBottomLeftRadius:Me,width:Me,maxWidth:Me,height:Me,maxHeight:Me,size:Me,top:Me,right:Me,bottom:Me,left:Me,padding:Me,paddingTop:Me,paddingRight:Me,paddingBottom:Me,paddingLeft:Me,margin:Me,marginTop:Me,marginRight:Me,marginBottom:Me,marginLeft:Me,rotate:Ae,rotateX:Ae,rotateY:Ae,rotateZ:Ae,scale:ke,scaleX:ke,scaleY:ke,scaleZ:ke,skew:Ae,skewX:Ae,skewY:Ae,distance:Me,translateX:Me,translateY:Me,translateZ:Me,x:Me,y:Me,z:Me,perspective:Me,transformPerspective:Me,opacity:be,originX:Oe,originY:Oe,originZ:Me,zIndex:Fe,fillOpacity:be,strokeOpacity:be,numOctaves:Fe};function Ve(e,t,n,r){const{style:o,vars:i,transform:s,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const e in t){const n=t[e];if(me(e)){i[e]=n;continue}const r=Re[e],h=ye(n,r);if(ce.has(e)){if(l=!0,s[e]=h,!u)continue;n!==(r.default||0)&&(u=!1)}else e.startsWith("origin")?(c=!0,a[e]=h):o[e]=h}if(t.transform||(l||r?o.transform=function(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,o){let i="";for(let t=0;t<fe;t++){const n=le[t];void 0!==e[n]&&(i+=`${de[n]||n}(${e[n]}) `)}return t&&!e.z&&(i+="translateZ(0)"),i=i.trim(),o?i=o(e,r?"":i):n&&r&&(i="none"),i}(e.transform,n,u,r):o.transform&&(o.transform="none")),c){const{originX:e="50%",originY:t="50%",originZ:n=0}=a;o.transformOrigin=`${e} ${t} ${n}`}}const je=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ne(e,t,n){for(const r in t)he(t[r])||ue(r,n)||(e[r]=t[r])}function Be(e,t,n){const r={};return Ne(r,e.style||{},e),Object.assign(r,function({transformTemplate:e},t,n){return c((()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return Ve(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)}),[t])}(e,t,n)),e.transformValues?e.transformValues(r):r}function ze(e,t,n){const r={},o=Be(e,t,n);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}const _e=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 Ue(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||_e.has(e)}let He=e=>!Ue(e);try{(We=require("@emotion/is-prop-valid").default)&&(He=e=>e.startsWith("on")?!Ue(e):We(e))}catch(e){}var We;function $e(e,t,n){return"string"==typeof e?e:Me.transform(t+n*e)}const qe={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ye={offset:"strokeDashoffset",array:"strokeDasharray"};function Xe(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,h,d){if(Ve(e,c,u,d),h)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(void 0!==o||void 0!==i||p.transform)&&(p.transformOrigin=function(e,t,n){return`${$e(t,e.x,e.width)} ${$e(n,e.y,e.height)}`}(m,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==t&&(f.x=t),void 0!==n&&(f.y=n),void 0!==r&&(f.scale=r),void 0!==s&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?qe:Ye;e[i.offset]=Me.transform(-r);const s=Me.transform(t),a=Me.transform(n);e[i.array]=`${s} ${a}`}(f,s,a,l,!1)}const Ke=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Ge=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Ze(e,t,n,r){const o=c((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Xe(n,t,{enableHardwareAcceleration:!1},Ge(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};Ne(t,e.style,e),o.style={...t,...o.style}}return o}function Qe(e=!1){return(t,n,r,{latestValues:o},i)=>{const s=(se(t)?Ze:ze)(n,o,i,t),a=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(He(o)||!0===n&&Ue(o)||!t&&!Ue(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),l={...a,...s,ref:r},{children:u}=n,d=c((()=>he(u)?u.get():u),[u]);return h(t,{...l,children:d})}}function Je(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const et=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 tt(e,t,n,r){Je(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(et.has(n)?n:z(n),t.attrs[n])}function nt(e,t){const{style:n}=e,r={};for(const o in n)(he(n[o])||t.style&&he(t.style[o])||ue(o,e))&&(r[o]=n[o]);return r}function rt(e,t){const n=nt(e,t);for(const r in e)if(he(e[r])||he(t[r])){n[-1!==le.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=e[r]}return n}function ot(e,t,n,r={},o={}){return"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,o)),"string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,o)),t}function it(e){const t=s(null);return null===t.current&&(t.current=e()),t.current}const st=e=>Array.isArray(e);function at(e){const t=he(e)?e.get():e;return n=t,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?t.toValue():t;var n}const lt=e=>(t,n)=>{const r=i(R),o=i(V),s=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,o,i){const s={latestValues:ct(r,o,i,e),renderState:t()};return n&&(s.mount=e=>n(r,e,s)),s}(e,t,r,o);return n?s():it(s)};function ct(e,t,n,r){const o={},i=r(e,{});for(const e in i)o[e]=at(i[e]);let{initial:s,animate:a}=e;const l=Y(e),c=X(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===a&&(a=t.animate));let u=!!n&&!1===n.initial;u=u||!1===s;const h=u?a:s;if(h&&"boolean"!=typeof h&&!W(h)){(Array.isArray(h)?h:[h]).forEach((t=>{const n=ot(e,t);if(!n)return;const{transitionEnd:r,transition:i,...s}=n;for(const e in s){let t=s[e];if(Array.isArray(t)){t=t[u?t.length-1:0]}null!==t&&(o[e]=t)}for(const e in r)o[e]=r[e]}))}return o}const ut=e=>e;class ht{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const t=this.order.indexOf(e);-1!==t&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}const dt=["prepare","read","update","preRender","render","postRender"];const{schedule:ft,cancel:pt,state:mt,steps:gt}=function(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=dt.reduce(((e,t)=>(e[t]=function(e){let t=new ht,n=new ht,r=0,o=!1,i=!1;const s=new WeakSet,a={schedule:(e,i=!1,a=!1)=>{const l=a&&o,c=l?t:n;return i&&s.add(e),c.add(e)&&l&&o&&(r=t.order.length),e},cancel:e=>{n.remove(e),s.delete(e)},process:l=>{if(o)i=!0;else{if(o=!0,[t,n]=[n,t],n.clear(),r=t.order.length,r)for(let n=0;n<r;n++){const r=t.order[n];r(l),s.has(r)&&(a.schedule(r),e())}o=!1,i&&(i=!1,a.process(l))}}};return a}((()=>n=!0)),e)),{}),s=e=>i[e].process(o),a=()=>{const i=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,dt.forEach(s),o.isProcessing=!1,n&&t&&(r=!1,e(a))};return{schedule:dt.reduce(((t,s)=>{const l=i[s];return t[s]=(t,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(a)),l.schedule(t,i,s)),t}),{}),cancel:e=>dt.forEach((t=>i[t].cancel(e))),state:o,steps:i}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:ut,!0),yt={useVisualState:lt({scrapeMotionValuesFromProps:rt,createRenderState:Ke,onMount:(e,t,{renderState:n,latestValues:r})=>{ft.read((()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}})),ft.render((()=>{Xe(n,r,{enableHardwareAcceleration:!1},Ge(t.tagName),e.transformTemplate),tt(t,n)}))}})},vt={useVisualState:lt({scrapeMotionValuesFromProps:nt,createRenderState:je})};function xt(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const bt=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function kt(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}function wt(e,t,n,r){return xt(e,t,(e=>t=>bt(t)&&e(t,kt(t)))(n),r)}const St=(e,t)=>n=>t(e(n)),Ct=(...e)=>e.reduce(St);function Et(e){let t=null;return()=>{const n=()=>{t=null};return null===t&&(t=e,n)}}const Pt=Et("dragHorizontal"),Tt=Et("dragVertical");function At(e){let t=!1;if("y"===e)t=Tt();else if("x"===e)t=Pt();else{const e=Pt(),n=Tt();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function Dt(){const e=At(!0);return!e||(e(),!1)}class Mt{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Lt(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End");return wt(e.current,n,((n,o)=>{if("touch"===n.pointerType||Dt())return;const i=e.getProps();e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",t),i[r]&&ft.update((()=>i[r](n,o)))}),{passive:!e.getProps()[r]})}const It=(e,t)=>!!t&&(e===t||It(e,t.parentElement));function Ot(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,kt(n))}const Ft=new WeakMap,Rt=new WeakMap,Vt=e=>{const t=Ft.get(e.target);t&&t(e)},jt=e=>{e.forEach(Vt)};function Nt(e,t,n){const r=function({root:e,...t}){const n=e||document;Rt.has(n)||Rt.set(n,{});const r=Rt.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(jt,{root:e,...t})),r[o]}(t);return Ft.set(e,n),r.observe(e),()=>{Ft.delete(e),r.unobserve(e)}}const Bt={some:0,all:1};const zt={inView:{Feature:class extends Mt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e,i={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Bt[r]};return Nt(this.node.current,i,(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node,n=["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t));n&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Mt{constructor(){super(...arguments),this.removeStartListeners=ut,this.removeEndListeners=ut,this.removeAccessibleListeners=ut,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=wt(window,"pointerup",((e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:o}=this.node.getProps();ft.update((()=>{o||It(this.node.current,e.target)?n&&n(e,t):r&&r(e,t)}))}),{passive:!(n.onTap||n.onPointerUp)}),o=wt(window,"pointercancel",((e,t)=>this.cancelPress(e,t)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Ct(r,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=xt(this.node.current,"keydown",(e=>{if("Enter"!==e.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=xt(this.node.current,"keyup",(e=>{"Enter"===e.key&&this.checkPressEnd()&&Ot("up",((e,t)=>{const{onTap:n}=this.node.getProps();n&&ft.update((()=>n(e,t)))}))})),Ot("down",((e,t)=>{this.startPress(e,t)}))})),t=xt(this.node.current,"blur",(()=>{this.isPressing&&Ot("cancel",((e,t)=>this.cancelPress(e,t)))}));this.removeAccessibleListeners=Ct(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&ft.update((()=>n(e,t)))}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Dt()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&ft.update((()=>n(e,t)))}mount(){const e=this.node.getProps(),t=wt(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=xt(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Ct(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends Mt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&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=Ct(xt(this.node.current,"focus",(()=>this.onFocus())),xt(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends Mt{mount(){this.unmount=Ct(Lt(this.node,!0),Lt(this.node,!1))}unmount(){}}}};function _t(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 Ut(e,t,n){const r=e.getProps();return ot(r,t,void 0!==n?n:r.custom,function(e){const t={};return e.values.forEach(((e,n)=>t[n]=e.get())),t}(e),function(e){const t={};return e.values.forEach(((e,n)=>t[n]=e.getVelocity())),t}(e))}let Ht=ut,Wt=ut;"production"!==process.env.NODE_ENV&&(Ht=(e,t)=>{e||"undefined"==typeof console||console.warn(t)},Wt=(e,t)=>{if(!e)throw new Error(t)});const $t=e=>1e3*e,qt=e=>e/1e3,Yt=!1,Xt=e=>Array.isArray(e)&&"number"==typeof e[0];function Kt(e){return Boolean(!e||"string"==typeof e&&Zt[e]||Xt(e)||Array.isArray(e)&&e.every(Kt))}const Gt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Zt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Gt([0,.65,.55,1]),circOut:Gt([.55,0,1,.45]),backIn:Gt([.31,.01,.66,-.59]),backOut:Gt([.33,1.53,.69,.99])};function Qt(e){if(e)return Xt(e)?Gt(e):Array.isArray(e)?e.map(Qt):Zt[e]}const Jt=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function en(e,t,n,r){if(e===t&&n===r)return ut;const o=t=>function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=Jt(s,r,o)-e,i>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<12);return s}(t,0,1,e,n);return e=>0===e||1===e?e:Jt(o(e),t,r)}const tn=en(.42,0,1,1),nn=en(0,0,.58,1),rn=en(.42,0,.58,1),on=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,sn=e=>t=>1-e(1-t),an=e=>1-Math.sin(Math.acos(e)),ln=sn(an),cn=on(an),un=en(.33,1.53,.69,.99),hn=sn(un),dn=on(hn),fn={linear:ut,easeIn:tn,easeInOut:rn,easeOut:nn,circIn:an,circInOut:cn,circOut:ln,backIn:hn,backInOut:dn,backOut:un,anticipate:e=>(e*=2)<1?.5*hn(e):.5*(2-Math.pow(2,-10*(e-1)))},pn=e=>{if(Array.isArray(e)){Wt(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return en(t,n,r,o)}return"string"==typeof e?(Wt(void 0!==fn[e],`Invalid easing type '${e}'`),fn[e]):e},mn=(e,t)=>n=>Boolean(Pe(n)&&Ee.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),gn=(e,t,n)=>r=>{if(!Pe(r))return r;const[o,i,s,a]=r.match(Se);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},yn={...xe,transform:e=>Math.round((e=>ve(0,255,e))(e))},vn={test:mn("rgb","red"),parse:gn("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+yn.transform(e)+", "+yn.transform(t)+", "+yn.transform(n)+", "+we(be.transform(r))+")"};const xn={test:mn("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:vn.transform},bn={test:mn("hsl","hue"),parse:gn("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+De.transform(we(t))+", "+De.transform(we(n))+", "+we(be.transform(r))+")"},kn={test:e=>vn.test(e)||xn.test(e)||bn.test(e),parse:e=>vn.test(e)?vn.parse(e):bn.test(e)?bn.parse(e):xn.parse(e),transform:e=>Pe(e)?e:e.hasOwnProperty("red")?vn.transform(e):bn.transform(e)},wn=(e,t,n)=>-n*e+n*t+e;function Sn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}const Cn=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},En=[xn,vn,bn];function Pn(e){const t=(n=e,En.find((e=>e.test(n))));var n;Wt(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`);let r=t.parse(e);return t===bn&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=Sn(a,r,e+1/3),i=Sn(a,r,e),s=Sn(a,r,e-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(r)),r}const Tn=(e,t)=>{const n=Pn(e),r=Pn(t),o={...n};return e=>(o.red=Cn(n.red,r.red,e),o.green=Cn(n.green,r.green,e),o.blue=Cn(n.blue,r.blue,e),o.alpha=wn(n.alpha,r.alpha,e),vn.transform(o))};const An={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:ut},Dn={regex:Ce,countKey:"Colors",token:"${c}",parse:kn.parse},Mn={regex:Se,countKey:"Numbers",token:"${n}",parse:xe.parse};function Ln(e,{regex:t,countKey:n,token:r,parse:o}){const i=e.tokenised.match(t);i&&(e["num"+n]=i.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...i.map(o)))}function In(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Ln(n,An),Ln(n,Dn),Ln(n,Mn),n}function On(e){return In(e).values}function Fn(e){const{values:t,numColors:n,numVars:r,tokenised:o}=In(e),i=t.length;return e=>{let t=o;for(let o=0;o<i;o++)t=o<r?t.replace(An.token,e[o]):o<r+n?t.replace(Dn.token,kn.transform(e[o])):t.replace(Mn.token,we(e[o]));return t}}const Rn=e=>"number"==typeof e?0:e;const Vn={test:function(e){var t,n;return isNaN(e)&&Pe(e)&&((null===(t=e.match(Se))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Ce))||void 0===n?void 0:n.length)||0)>0},parse:On,createTransformer:Fn,getAnimatableNone:function(e){const t=On(e);return Fn(e)(t.map(Rn))}},jn=(e,t)=>n=>`${n>0?t:e}`;function Nn(e,t){return"number"==typeof e?n=>wn(e,t,n):kn.test(e)?Tn(e,t):e.startsWith("var(")?jn(e,t):_n(e,t)}const Bn=(e,t)=>{const n=[...e],r=n.length,o=e.map(((e,n)=>Nn(e,t[n])));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}},zn=(e,t)=>{const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=Nn(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}},_n=(e,t)=>{const n=Vn.createTransformer(t),r=In(e),o=In(t);return r.numVars===o.numVars&&r.numColors===o.numColors&&r.numNumbers>=o.numNumbers?Ct(Bn(r.values,o.values),n):(Ht(!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.`),jn(e,t))},Un=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Hn=(e,t)=>n=>wn(e,t,n);function Wn(e,t,n){const r=[],o=n||("number"==typeof(i=e[0])?Hn:"string"==typeof i?kn.test(i)?Tn:_n:Array.isArray(i)?Bn:"object"==typeof i?zn:Hn);var i;const s=e.length-1;for(let n=0;n<s;n++){let i=o(e[n],e[n+1]);if(t){const e=Array.isArray(t)?t[n]||ut:t;i=Ct(e,i)}r.push(i)}return r}function $n(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Wt(i===t.length,"Both input and output ranges must be the same length"),1===i)return()=>t[0];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=Wn(t,r,o),a=s.length,l=t=>{let n=0;if(a>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const r=Un(e[n],e[n+1],t);return s[n](r)};return n?t=>l(ve(e[0],e[i-1],t)):l}function qn(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Un(0,t,r);e.push(wn(n,1,o))}}(t,e.length-1),t}function Yn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(pn):pn(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:qn(t),e),a=$n(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||rn)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}function Xn(e,t){return t?e*(1e3/t):0}function Kn(e,t,n){const r=Math.max(t-5,0);return Xn(n-e(r),t-r)}const Gn=.001;function Zn({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;Ht(e<=$t(10),"Spring duration must be 10 seconds or less");let s=1-t;s=ve(.05,1,s),e=ve(.01,10,qt(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=Jn(t,s),l=Math.exp(-o);return Gn-i/a*l},i=t=>{const r=t*s*e,i=r*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=Jn(Math.pow(t,2),s);return(-o(t)+Gn>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;n<Qn;n++)r-=e(r)/t(r);return r}(o,i,5/e);if(e=$t(e),isNaN(a))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(a,2)*r;return{stiffness:t,damping:2*s*Math.sqrt(r*t),duration:e}}}const Qn=12;function Jn(e,t){return e*Math.sqrt(1-t*t)}const er=["duration","bounce"],tr=["stiffness","damping","mass"];function nr(e,t){return t.some((t=>void 0!==e[t]))}function rr({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],s={done:!1,value:o},{stiffness:a,damping:l,mass:c,duration:u,velocity:h,isResolvedFromDuration:d}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!nr(e,tr)&&nr(e,er)){const n=Zn(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...r,velocity:-qt(r.velocity||0)}),f=h||0,p=l/(2*Math.sqrt(a*c)),m=i-o,g=qt(Math.sqrt(a/c)),y=Math.abs(m)<5;let v;if(n||(n=y?.01:2),t||(t=y?.005:.5),p<1){const e=Jn(g,p);v=t=>{const n=Math.exp(-p*g*t);return i-n*((f+p*g*m)/e*Math.sin(e*t)+m*Math.cos(e*t))}}else if(1===p)v=e=>i-Math.exp(-g*e)*(m+(f+g*m)*e);else{const e=g*Math.sqrt(p*p-1);v=t=>{const n=Math.exp(-p*g*t),r=Math.min(e*t,300);return i-n*((f+p*g*m)*Math.sinh(r)+e*m*Math.cosh(r))/e}}return{calculatedDuration:d&&u||null,next:e=>{const r=v(e);if(d)s.done=e>=u;else{let o=f;0!==e&&(o=p<1?Kn(v,e,r):0);const a=Math.abs(o)<=n,l=Math.abs(i-r)<=t;s.done=a&&l}return s.value=s.done?i:r,s}}}function or({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=e[0],d={done:!1,value:h},f=e=>void 0===a?l:void 0===l||Math.abs(a-e)<Math.abs(l-e)?a:l;let p=n*t;const m=h+p,g=void 0===s?m:s(m);g!==m&&(p=g-h);const y=e=>-p*Math.exp(-e/r),v=e=>g+y(e),x=e=>{const t=y(e),n=v(e);d.done=Math.abs(t)<=c,d.value=d.done?g:n};let b,k;const w=e=>{var t;(t=d.value,void 0!==a&&t<a||void 0!==l&&t>l)&&(b=e,k=rr({keyframes:[d.value,f(d.value)],velocity:Kn(v,e,d.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return w(0),{calculatedDuration:null,next:e=>{let t=!1;return k||void 0!==b||(t=!0,x(e),w(e)),void 0!==b&&e>b?k.next(e-b):(!t&&x(e),d)}}}const ir=e=>{const t=({timestamp:t})=>e(t);return{start:()=>ft.update(t,!0),stop:()=>pt(t),now:()=>mt.isProcessing?mt.timestamp:performance.now()}};function sr(e){let t=0;let n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}const ar={decay:or,inertia:or,tween:Yn,keyframes:Yn,spring:rr};function lr({autoplay:e=!0,delay:t=0,driver:n=ir,keyframes:r,type:o="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:h,...d}){let f,p,m=1,g=!1;const y=()=>{p=new Promise((e=>{f=e}))};let v;y();const x=ar[o]||Yn;let b;x!==Yn&&"number"!=typeof r[0]&&("production"!==process.env.NODE_ENV&&Wt(2===r.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${r}`),b=$n([0,100],r,{clamp:!1}),r=[0,100]);const k=x({...d,keyframes:r});let w;"mirror"===a&&(w=x({...d,keyframes:[...r].reverse(),velocity:-(d.velocity||0)}));let S="idle",C=null,E=null,P=null;null===k.calculatedDuration&&i&&(k.calculatedDuration=sr(k));const{calculatedDuration:T}=k;let A=1/0,D=1/0;null!==T&&(A=T+s,D=A*(i+1)-s);let M=0;const L=e=>{if(null===E)return;m>0&&(E=Math.min(E,e)),m<0&&(E=Math.min(e-D/m,E)),M=null!==C?C:Math.round(e-E)*m;const n=M-t*(m>=0?1:-1),o=m>=0?n<0:n>D;M=Math.max(n,0),"finished"===S&&null===C&&(M=D);let l=M,c=k;if(i){const e=Math.min(M,D)/A;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,i+1);Boolean(t%2)&&("reverse"===a?(n=1-n,s&&(n-=s/A)):"mirror"===a&&(c=w)),l=ve(0,1,n)*A}const u=o?{done:!1,value:r[0]}:c.next(l);b&&(u.value=b(u.value));let{done:d}=u;o||null===T||(d=m>=0?M>=D:M<=0);const f=null===C&&("finished"===S||"running"===S&&d);return h&&h(u.value),f&&F(),u},I=()=>{v&&v.stop(),v=void 0},O=()=>{S="idle",I(),f(),y(),E=P=null},F=()=>{S="finished",u&&u(),I(),f()},R=()=>{if(g)return;v||(v=n(L));const e=v.now();l&&l(),null!==C?E=e-C:E&&"finished"!==S||(E=e),"finished"===S&&y(),P=E,C=null,S="running",v.start()};e&&R();const V={then:(e,t)=>p.then(e,t),get time(){return qt(M)},set time(e){e=$t(e),M=e,null===C&&v&&0!==m?E=v.now()-e/m:C=e},get duration(){const e=null===k.calculatedDuration?sr(k):k.calculatedDuration;return qt(e)},get speed(){return m},set speed(e){e!==m&&v&&(m=e,V.time=qt(M))},get state(){return S},play:R,pause:()=>{S="paused",C=M},stop:()=>{g=!0,"idle"!==S&&(S="idle",c&&c(),O())},cancel:()=>{null!==P&&L(P),O()},complete:()=>{S="finished"},sample:e=>(E=0,L(e))};return V}const cr=function(e){let t;return()=>(void 0===t&&(t=e()),t)}((()=>Object.hasOwnProperty.call(Element.prototype,"animate"))),ur=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);function hr(e,t,{onUpdate:n,onComplete:r,...o}){if(!(cr()&&ur.has(t)&&!o.repeatDelay&&"mirror"!==o.repeatType&&0!==o.damping&&"inertia"!==o.type))return!1;let i,s,a=!1,l=!1;const c=()=>{s=new Promise((e=>{i=e}))};c();let{keyframes:u,duration:h=300,ease:d,times:f}=o;if(((e,t)=>"spring"===t.type||"backgroundColor"===e||!Kt(t.ease))(t,o)){const e=lr({...o,repeat:0,delay:0});let t={done:!1,value:u[0]};const n=[];let r=0;for(;!t.done&&r<2e4;)t=e.sample(r),n.push(t.value),r+=10;f=void 0,u=n,h=r-10,d="linear"}const p=function(e,t,n,{delay:r=0,duration:o,repeat:i=0,repeatType:s="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=Qt(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}(e.owner.current,t,u,{...o,duration:h,ease:d,times:f}),m=()=>{l=!1,p.cancel()},g=()=>{l=!0,ft.update(m),i(),c()};p.onfinish=()=>{l||(e.set(function(e,{repeat:t,repeatType:n="loop"}){return e[t&&"loop"!==n&&t%2==1?0:e.length-1]}(u,o)),r&&r(),g())};return{then:(e,t)=>s.then(e,t),attachTimeline:e=>(p.timeline=e,p.onfinish=null,ut),get time(){return qt(p.currentTime||0)},set time(e){p.currentTime=$t(e)},get speed(){return p.playbackRate},set speed(e){p.playbackRate=e},get duration(){return qt(h)},play:()=>{a||(p.play(),pt(m))},pause:()=>p.pause(),stop:()=>{if(a=!0,"idle"===p.playState)return;const{currentTime:t}=p;if(t){const n=lr({...o,autoplay:!1});e.setWithVelocity(n.sample(t-10).value,n.sample(t).value,10)}g()},complete:()=>{l||p.finish()},cancel:g}}const dr={type:"spring",stiffness:500,damping:25,restSpeed:10},fr={type:"keyframes",duration:.8},pr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},mr=(e,{keyframes:t})=>t.length>2?fr:ce.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:dr:pr,gr=(e,t)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Vn.test(t)&&"0"!==t||t.startsWith("url("))),yr=new Set(["brightness","contrast","saturate","opacity"]);function vr(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Se)||[];if(!r)return e;const o=n.replace(r,"");let i=yr.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const xr=/([a-z-]*)\(.*?\)/g,br={...Vn,getAnimatableNone:e=>{const t=e.match(xr);return t?t.map(vr).join(" "):e}},kr={...Re,color:kn,backgroundColor:kn,outlineColor:kn,fill:kn,stroke:kn,borderColor:kn,borderTopColor:kn,borderRightColor:kn,borderBottomColor:kn,borderLeftColor:kn,filter:br,WebkitFilter:br},wr=e=>kr[e];function Sr(e,t){let n=wr(e);return n!==br&&(n=Vn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Cr=e=>/^0[^.\s]+$/.test(e);function Er(e){return"number"==typeof e?0===e:null!==e?"none"===e||"0"===e||Cr(e):void 0}function Pr(e,t){return e[t]||e.default||e}const Tr=!1,Ar=(e,t,n,r={})=>o=>{const i=Pr(r,e)||{},s=i.delay||r.delay||0;let{elapsed:a=0}=r;a-=$t(s);const l=function(e,t,n,r){const o=gr(t,n);let i;i=Array.isArray(n)?[...n]:[null,n];const s=void 0!==r.from?r.from:e.get();let a;const l=[];for(let e=0;e<i.length;e++)null===i[e]&&(i[e]=0===e?s:i[e-1]),Er(i[e])&&l.push(e),"string"==typeof i[e]&&"none"!==i[e]&&"0"!==i[e]&&(a=i[e]);if(o&&l.length&&a)for(let e=0;e<l.length;e++)i[l[e]]=Sr(t,a);return i}(t,e,n,i),c=l[0],u=l[l.length-1],h=gr(e,c),d=gr(e,u);Ht(h===d,`You are trying to animate ${e} from "${c}" to "${u}". ${c} is not an animatable value - to enable this animation set ${c} to a value animatable to ${u} via the \`style\` property.`);let f={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...i,delay:-a,onUpdate:e=>{t.set(e),i.onUpdate&&i.onUpdate(e)},onComplete:()=>{o(),i.onComplete&&i.onComplete()}};if(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}(i)||(f={...f,...mr(e,f)}),f.duration&&(f.duration=$t(f.duration)),f.repeatDelay&&(f.repeatDelay=$t(f.repeatDelay)),!h||!d||Yt||!1===i.type||Tr)return function({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const o=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:ut,pause:ut,stop:ut,then:e=>(e(),Promise.resolve()),cancel:ut,complete:ut});return t?lr({keyframes:[0,1],duration:0,delay:t,onComplete:o}):o()}(f);if(!r.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const n=hr(t,e,f);if(n)return n}return lr(f)};function Dr(e){return Boolean(he(e)&&e.add)}const Mr=e=>/^\-?\d*\.?\d+$/.test(e);function Lr(e,t){-1===e.indexOf(t)&&e.push(t)}function Ir(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Or{constructor(){this.subscriptions=[]}add(e){return Lr(this.subscriptions,e),()=>Ir(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Fr=new Set;function Rr(e,t,n){e||Fr.has(t)||(console.warn(t),Fr.add(t))}class Vr{constructor(e,t={}){var n;this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(e,t=!0)=>{this.prev=this.current,this.current=e;const{delta:n,timestamp:r}=mt;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,ft.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()),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>ft.postRender(this.velocityCheck),this.velocityCheck=({timestamp:e})=>{e!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=t.owner}onChange(e){return"production"!==process.env.NODE_ENV&&Rr(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Or);const n=this.events[e].add(t);return"change"===e?()=>{n(),ft.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=e,this.timeDelta=n}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Xn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function jr(e,t){return new Vr(e,t)}const Nr=e=>t=>t.test(e),Br=[xe,Me,De,Ae,Ie,Le,{test:e=>"auto"===e,parse:e=>e}],zr=e=>Br.find(Nr(e)),_r=[...Br,kn,Vn];function Ur(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,jr(n))}function Hr(e,t){if(!t)return;return(t[e]||t.default||t).from}function Wr({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function $r(e,t){const n=e.get();if(!Array.isArray(t))return n!==t;for(let e=0;e<t.length;e++)if(t[e]!==n)return!0}function qr(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:s,...a}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");r&&(i=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const t in a){const r=e.getValue(t),o=a[t];if(!r||void 0===o||u&&Wr(u,t))continue;const s={delay:n,elapsed:0,...Pr(i||{},t)};if(window.HandoffAppearAnimations){const n=e.getProps()[_];if(n){const e=window.HandoffAppearAnimations(n,t,r,ft);null!==e&&(s.elapsed=e,s.isHandoff=!0)}}let h=!s.isHandoff&&!$r(r,o);if("spring"===s.type&&(r.getVelocity()||s.velocity)&&(h=!1),r.animation&&(h=!1),h)continue;r.start(Ar(t,r,o,e.shouldReduceMotion&&ce.has(t)?{type:!1}:s));const d=r.animation;Dr(l)&&(l.add(t),d.then((()=>l.remove(t)))),c.push(d)}return s&&Promise.all(c).then((()=>{s&&function(e,t){const n=Ut(e,t);let{transitionEnd:r={},transition:o={},...i}=n?e.makeTargetAnimatable(n,!1):{};i={...i,...r};for(const t in i)Ur(e,t,(s=i[t],st(s)?s[s.length-1]||0:s));var s}(e,s)})),c}function Yr(e,t,n={}){const r=Ut(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(qr(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=o;return function(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(Xr).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(Yr(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(s)}(e,t,i+r,s,a,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[e,t]="beforeChildren"===a?[i,s]:[s,i];return e().then((()=>t()))}return Promise.all([i(),s(n.delay)])}function Xr(e,t){return e.sortNodePosition(t)}const Kr=[...$].reverse(),Gr=$.length;function Zr(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>Yr(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=Yr(e,t,n);else{const o="function"==typeof t?Ut(e,t,n.custom):t;r=Promise.all(qr(e,o,n))}return r.then((()=>e.notify("AnimationComplete",t)))}(e,t,n))))}function Qr(e){let t=Zr(e);const n={animate:eo(!0),whileInView:eo(),whileHover:eo(),whileTap:eo(),whileDrag:eo(),whileFocus:eo(),exit:eo()};let r=!0;const o=(t,n)=>{const r=Ut(e,n);if(r){const{transition:e,transitionEnd:n,...o}=r;t={...t,...o,...n}}return t};function i(i,s){const a=e.getProps(),l=e.getVariantContext(!0)||{},c=[],u=new Set;let h={},d=1/0;for(let t=0;t<Gr;t++){const f=Kr[t],p=n[f],m=void 0!==a[f]?a[f]:l[f],g=H(m),y=f===s?p.isActive:null;!1===y&&(d=t);let v=m===l[f]&&m!==a[f]&&g;if(v&&r&&e.manuallyAnimateOnMount&&(v=!1),p.protectedKeys={...h},!p.isActive&&null===y||!m&&!p.prevProp||W(m)||"boolean"==typeof m)continue;let x=Jr(p.prevProp,m)||f===s&&p.isActive&&!v&&g||t>d&&g,b=!1;const k=Array.isArray(m)?m:[m];let w=k.reduce(o,{});!1===y&&(w={});const{prevResolvedValues:S={}}=p,C={...S,...w},E=e=>{x=!0,u.has(e)&&(b=!0,u.delete(e)),p.needsAnimating[e]=!0};for(const e in C){const t=w[e],n=S[e];if(h.hasOwnProperty(e))continue;let r=!1;r=st(t)&&st(n)?!_t(t,n):t!==n,r?void 0!==t?E(e):u.add(e):void 0!==t&&u.has(e)?E(e):p.protectedKeys[e]=!0}p.prevProp=m,p.prevResolvedValues=w,p.isActive&&(h={...h,...w}),r&&e.blockInitialAnimation&&(x=!1),!x||v&&!b||c.push(...k.map((e=>({animation:e,options:{type:f,...i}}))))}if(u.size){const t={};u.forEach((n=>{const r=e.getBaseTarget(n);void 0!==r&&(t[n]=r)})),c.push({animation:t})}let f=Boolean(c.length);return!r||!1!==a.initial&&a.initial!==a.animate||e.manuallyAnimateOnMount||(f=!1),r=!1,f?t(c):Promise.resolve()}return{animateChanges:i,setActive:function(t,r,o){var s;if(n[t].isActive===r)return Promise.resolve();null===(s=e.variantChildren)||void 0===s||s.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const a=i(o,t);for(const e in n)n[e].protectedKeys={};return a},setAnimateFunction:function(n){t=n(e)},getState:()=>n}}function Jr(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!_t(t,e)}function eo(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let to=0;const no={animation:{Feature:class extends Mt{constructor(e){super(e),e.animationState||(e.animationState=Qr(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),W(e)&&(this.unm